| 8 | use heraclitus_compiler::prelude::*; |
| 9 | |
| 10 | pub fn skip_function_body(meta: &mut ParserMetadata) -> (usize, usize, bool) { |
| 11 | let index_begin = meta.get_index(); |
| 12 | let mut is_failable = false; |
| 13 | let mut scope = 1; |
| 14 | while let Some(tok) = meta.get_current_token() { |
| 15 | match tok.word.as_str() { |
| 16 | "{" => scope += 1, |
| 17 | "}" => scope -= 1, |
| 18 | "fail" => is_failable = true, |
| 19 | "?" => is_failable = true, |
| 20 | _ => {} |
| 21 | } |
| 22 | if scope == 0 { |
| 23 | break; |
| 24 | } |
| 25 | meta.increment_index(); |
| 26 | } |
| 27 | let index_end = meta.get_index(); |
| 28 | (index_begin, index_end, is_failable) |
| 29 | } |
| 30 | |
| 31 | pub fn is_functions_comment_doc(meta: &mut ParserMetadata) -> bool { |
| 32 | let index = meta.get_index(); |