Skip to content

Commit c7c8959

Browse files
Docs: Synchronize parser token stream on error to prevent cascading false positives.
1 parent 986683b commit c7c8959

File tree

1 file changed

+1
-0
lines changed
  • compiler/src/modules/parser

1 file changed

+1
-0
lines changed

compiler/src/modules/parser/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ impl<'src, I: Iterator<Item = Token>> Parser<'src, I> {
167167
.unwrap_or((0, 0, 0));
168168
self.errors.push(Diagnostic { line, col, end, msg: msg.to_string() });
169169

170+
// Sync to next statement boundary to suppress cascading false positives.
170171
loop {
171172
match self.tokens.peek().map(|t| t.kind) {
172173
None

0 commit comments

Comments
 (0)