Skip to content

Commit

Permalink
polish: fix lexer state comment (#4294)
Browse files Browse the repository at this point in the history
we must update the lexer line number and the line start position,
because lookahead saves the token within the linked list, and so will
never be called again on this token

we do not change the current token, however, until the lexer is advanced

closes #2764
  • Loading branch information
yaacovCR authored Nov 11, 2024
1 parent 831c121 commit 92d4ed0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/language/lexer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export class Lexer {

/**
* Looks ahead and returns the next non-ignored token, but does not change
* the state of Lexer.
* the current Lexer token.
*/
lookahead(): Token {
let token = this.token;
Expand Down

0 comments on commit 92d4ed0

Please sign in to comment.