diff options
Diffstat (limited to 'lex.c')
-rw-r--r-- | lex.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -164,14 +164,14 @@ lex_alphanum(void) { } static struct token -lex_eol(void) { +lex_eol(char eolchar) { struct token t; t.type = TOK_EOL; t.loc = get_current_loc(); t.span = 1; - expect('\n'); + expect(eolchar); return t; } @@ -208,7 +208,11 @@ lex_line(void) { break; case '\r': case '\n': - add_token(lex_eol()); + add_token(lex_eol(buf[column_number])); + break; + case '#': + add_token(lex_eol(buf[column_number])); + return 0; break; default: /* perform more broad checks */ |