diff options
| author | Martin Haug <mhaug@live.de> | 2021-11-10 20:41:10 +0100 |
|---|---|---|
| committer | Martin Haug <mhaug@live.de> | 2021-11-10 20:41:10 +0100 |
| commit | 3162c6a83a910f34d6ed7e966c11b7e7b5bd4088 (patch) | |
| tree | ce14dfbc48186a010183c637614a6f2d54f12264 /src/parse/parser.rs | |
| parent | 91f2f97572c64d7eb25c88ad0ebb18192cf8eddf (diff) | |
Comments and neighbors
Diffstat (limited to 'src/parse/parser.rs')
| -rw-r--r-- | src/parse/parser.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/parse/parser.rs b/src/parse/parser.rs index 31c918a8..a37cb9c6 100644 --- a/src/parse/parser.rs +++ b/src/parse/parser.rs @@ -48,9 +48,9 @@ impl<'s> Parser<'s> { } /// End the parsing process and return multiple children. - pub fn eject(self) -> Option<Vec<Green>> { + pub fn eject(self) -> Option<(Vec<Green>, bool)>{ if self.eof() && self.group_success() { - Some(self.children) + Some((self.children, self.tokens.was_unterminated())) } else { None } @@ -97,8 +97,9 @@ impl<'s> Parser<'s> { /// End the parsing process and return multiple children, even if there /// remains stuff in the string. - pub fn eject_partial(self) -> Option<Vec<Green>> { - self.group_success().then(|| self.children) + pub fn eject_partial(self) -> Option<(Vec<Green>, bool)> { + self.group_success() + .then(|| (self.children, self.tokens.was_unterminated())) } /// Whether the end of the source string or group is reached. |
