Skip to content

Commit

Permalink
JS: clear lexer error when continuing lexing, see #118
Browse files Browse the repository at this point in the history
  • Loading branch information
tdewolff committed May 3, 2024
1 parent b5d42d6 commit 663ee1e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions js/lex.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ func (l *Lexer) RegExp() (TokenType, []byte) {

// Next returns the next Token. It returns ErrorToken when an error was encountered. Using Err() one can retrieve the error message.
func (l *Lexer) Next() (TokenType, []byte) {
l.err = nil // clear error from previous ErrorToken
prevLineTerminator := l.prevLineTerminator
l.prevLineTerminator = false

Expand Down

0 comments on commit 663ee1e

Please sign in to comment.