mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-07 08:08:50 +00:00
Minor simplification to #assert and #panic parsing
This commit is contained in:
+1
-6
@@ -4516,12 +4516,7 @@ Ast *parse_stmt(AstFile *f) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return s;
|
return s;
|
||||||
} else if (tag == "assert") {
|
} else if (tag == "assert" || tag == "panic") {
|
||||||
Ast *t = ast_basic_directive(f, hash_token, name);
|
|
||||||
Ast *stmt = ast_expr_stmt(f, parse_call_expr(f, t));
|
|
||||||
expect_semicolon(f, stmt);
|
|
||||||
return stmt;
|
|
||||||
} else if (tag == "panic") {
|
|
||||||
Ast *t = ast_basic_directive(f, hash_token, name);
|
Ast *t = ast_basic_directive(f, hash_token, name);
|
||||||
Ast *stmt = ast_expr_stmt(f, parse_call_expr(f, t));
|
Ast *stmt = ast_expr_stmt(f, parse_call_expr(f, t));
|
||||||
expect_semicolon(f, stmt);
|
expect_semicolon(f, stmt);
|
||||||
|
|||||||
Reference in New Issue
Block a user