Skip to content

Commit 3a38b3e

Browse files
committed
docs(exclude): clarify operator guard is for error message quality
1 parent ab074d4 commit 3a38b3e

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/parser/mod.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10093,9 +10093,10 @@ impl<'a> Parser<'a> {
1009310093
));
1009410094
}
1009510095

10096-
// Without this guard a bare `WITH` at the end of an element would
10097-
// consume the next structural delimiter (`,`, `)`, `;`, EOF) as the
10098-
// operator string, producing a silently wrong AST instead of an error.
10096+
// A missing operator would otherwise stringify the next structural
10097+
// delimiter (`,`, `)`, `;`, EOF) as the operator. The trailing RParen
10098+
// still rejects it downstream, but this points the error at the missing
10099+
// operator instead of a later token.
1009910100
let operator_token = self.next_token();
1010010101
if matches!(
1010110102
operator_token.token,

0 commit comments

Comments
 (0)