Browse Source

EOF in a function is an error

master
Martin Dørum 3 years ago
parent
commit
9f09ee7cfc
1 changed files with 2 additions and 1 deletions
  1. 2
    1
      lib/parse/parse.c

+ 2
- 1
lib/parse/parse.c View File

while (1) { while (1) {
struct l2_token *tok = l2_lexer_peek(lexer, 1); struct l2_token *tok = l2_lexer_peek(lexer, 1);
if (tok->kind == L2_TOK_EOF) { if (tok->kind == L2_TOK_EOF) {
break;
l2_parse_err(err, tok, "In function: Unexpected EOF");
return -1;
} else if (tok->kind == L2_TOK_CLOSE_BRACE) { } else if (tok->kind == L2_TOK_CLOSE_BRACE) {
l2_lexer_consume(lexer); // } l2_lexer_consume(lexer); // }
break; break;

Loading…
Cancel
Save