Minor simplification to #assert and #panic parsing

This commit is contained in:
gingerBill
2021-09-23 23:25:13 +01:00
parent ea555c0ccd
commit 20529c6512
+1 -6
View File
@@ -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);