diff options
| author | gingerBill <bill@gingerbill.org> | 2021-09-23 23:25:13 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2021-09-23 23:25:13 +0100 |
| commit | 20529c6512b573f1905b085097d3b0130fb3c5c7 (patch) | |
| tree | b09bafc6b03d6f5b937cae06d172340f11940271 /src/parser.cpp | |
| parent | ea555c0ccd871a6641171f066688332b823781b7 (diff) | |
Minor simplification to `#assert` and `#panic` parsing
Diffstat (limited to 'src/parser.cpp')
| -rw-r--r-- | src/parser.cpp | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/parser.cpp b/src/parser.cpp index 04d1dabc8..a897ff9aa 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -4516,16 +4516,11 @@ Ast *parse_stmt(AstFile *f) { break; } 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 *stmt = ast_expr_stmt(f, parse_call_expr(f, t)); - expect_semicolon(f, stmt); - return stmt; } else if (name.string == "force_inline" || name.string == "force_no_inline") { Ast *expr = parse_force_inlining_operand(f, name); |