Skip to content

Commit c85307e

Browse files
committed
Fix infinite loop in scanner.
1 parent 6376fa0 commit c85307e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/scanner.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ static bool scan_comment(TSLexer *lexer) {
113113
// Single-line comment
114114
do {
115115
advance(lexer);
116-
} while (lexer->lookahead != '\n');
116+
} while (lexer->lookahead != '\n' && !lexer->eof(lexer));
117117
return true;
118118

119119
case '*':

0 commit comments

Comments
 (0)