summaryrefslogtreecommitdiffstatshomepage
path: root/py/lexer.c
diff options
context:
space:
mode:
authorDamien <damien.p.george@gmail.com>2013-10-18 19:54:31 +0100
committerDamien <damien.p.george@gmail.com>2013-10-18 19:54:31 +0100
commit9f770c658f1dad3ea1aa3d32bf08277ba6411806 (patch)
tree79d7b85389a7e20c48df581b4a0c3ca4b477bca4 /py/lexer.c
parent4a175e1f110e0d6ad1b784054050be59a6e2c706 (diff)
downloadmicropython-9f770c658f1dad3ea1aa3d32bf08277ba6411806.tar.gz
micropython-9f770c658f1dad3ea1aa3d32bf08277ba6411806.zip
Fix up insertion of newline at end of lexer stream.
Diffstat (limited to 'py/lexer.c')
-rw-r--r--py/lexer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/py/lexer.c b/py/lexer.c
index 656dc6d329..7167b93276 100644
--- a/py/lexer.c
+++ b/py/lexer.c
@@ -178,7 +178,7 @@ static void next_char(py_lexer_t *lex) {
lex->chr2 = lex->src_cur[2];
} else {
// EOF
- if (lex->chr1 != '\n' && lex->chr1 != '\r') {
+ if (lex->chr1 != CHR_EOF && lex->chr1 != '\n' && lex->chr1 != '\r') {
lex->chr2 = '\n'; // insert newline at end of file
} else {
lex->chr2 = CHR_EOF;