Skip to content

polish: fix lexer state comment #4294

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix lookahead comment
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
commit caa36da95ca11f9c5640cf44220c85dfa81529c3
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
Loading