Skip to content

Commit

Permalink
fix lookahead comment
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
  • Loading branch information
yaacovCR committed Nov 11, 2024
1 parent 1d98a6a commit caa36da
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 caa36da

Please sign in to comment.