mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
check for semi-colon before EOF too
This commit is contained in:
+2
-1
@@ -1538,7 +1538,7 @@ void fix_advance_to_next_stmt(AstFile *f) {
|
|||||||
Token expect_closing(AstFile *f, TokenKind kind, String context) {
|
Token expect_closing(AstFile *f, TokenKind kind, String context) {
|
||||||
if (f->curr_token.kind != kind &&
|
if (f->curr_token.kind != kind &&
|
||||||
f->curr_token.kind == Token_Semicolon &&
|
f->curr_token.kind == Token_Semicolon &&
|
||||||
f->curr_token.string == "\n") {
|
(f->curr_token.string == "\n" || f->curr_token.kind == Token_EOF)) {
|
||||||
Token tok = f->prev_token;
|
Token tok = f->prev_token;
|
||||||
tok.pos.column += cast(i32)tok.string.len;
|
tok.pos.column += cast(i32)tok.string.len;
|
||||||
syntax_error(tok, "Missing ',' before newline in %.*s", LIT(context));
|
syntax_error(tok, "Missing ',' before newline in %.*s", LIT(context));
|
||||||
@@ -1560,6 +1560,7 @@ void assign_removal_flag_to_semicolon(AstFile *f) {
|
|||||||
switch (curr_token->kind) {
|
switch (curr_token->kind) {
|
||||||
case Token_CloseBrace:
|
case Token_CloseBrace:
|
||||||
case Token_CloseParen:
|
case Token_CloseParen:
|
||||||
|
case Token_EOF:
|
||||||
ok = true;
|
ok = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user