Skip to content

Commit 9f770c6

Browse files
committed
Fix up insertion of newline at end of lexer stream.
1 parent 4a175e1 commit 9f770c6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

py/lexer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ static void next_char(py_lexer_t *lex) {
178178
lex->chr2 = lex->src_cur[2];
179179
} else {
180180
// EOF
181-
if (lex->chr1 != '\n' && lex->chr1 != '\r') {
181+
if (lex->chr1 != CHR_EOF && lex->chr1 != '\n' && lex->chr1 != '\r') {
182182
lex->chr2 = '\n'; // insert newline at end of file
183183
} else {
184184
lex->chr2 = CHR_EOF;

0 commit comments

Comments
 (0)