diff options
| author | Martin Haug <mhaug@live.de> | 2022-02-03 11:31:53 +0100 |
|---|---|---|
| committer | Martin Haug <mhaug@live.de> | 2022-02-03 11:31:53 +0100 |
| commit | e32e9faa53e6c89a4555306a6c40186e58e01b6c (patch) | |
| tree | dfa685a1cb4396037d909b5055318bb98800890b /src/parse/parser.rs | |
| parent | 6a6753cb69f7c29e857fd465eecf66a02ff76aa3 (diff) | |
Fix incremental group bug
Diffstat (limited to 'src/parse/parser.rs')
| -rw-r--r-- | src/parse/parser.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/parse/parser.rs b/src/parse/parser.rs index 6c73d7dd..e495dbd0 100644 --- a/src/parse/parser.rs +++ b/src/parse/parser.rs @@ -267,11 +267,6 @@ impl<'s> Parser<'s> { /// This panics if no group was started. #[track_caller] pub fn end_group(&mut self) { - // If another group closes after a group with the missing terminator, - // its scope of influence ends here and no longer taints the rest of the - // reparse. - self.unterminated_group = false; - let group_mode = self.tokens.mode(); let group = self.groups.pop().expect("no started group"); self.tokens.set_mode(group.prev_mode); @@ -289,6 +284,11 @@ impl<'s> Parser<'s> { Group::Imports => None, } { if self.current.as_ref() == Some(&end) { + // If another group closes after a group with the missing terminator, + // its scope of influence ends here and no longer taints the rest of the + // reparse. + self.unterminated_group = false; + // Bump the delimeter and return. No need to rescan in this // case. Also, we know that the delimiter is not stray even // though we already removed the group. |
