diff options
| author | Ginger Bill <bill@gingerbill.org> | 2016-09-07 15:15:10 +0100 |
|---|---|---|
| committer | Ginger Bill <bill@gingerbill.org> | 2016-09-07 15:15:10 +0100 |
| commit | 2c4193a24226b084797af61e29c8355835c179a8 (patch) | |
| tree | 4a580168b5f094010e93047c0439bb770b45272b /src/parser.cpp | |
| parent | 61fcfd6f3d3c6cffd7e610abab83445b4cd1950d (diff) | |
`any` type
Diffstat (limited to 'src/parser.cpp')
| -rw-r--r-- | src/parser.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/parser.cpp b/src/parser.cpp index 3efb0451d..ec95e2926 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -2297,9 +2297,9 @@ AstNode *parse_match_stmt(AstFile *f) { Token open, close; if (allow_token(f, Token_type)) { + tag = parse_expr(f, true); + expect_token(f, Token_ArrowRight); AstNode *var = parse_identifier(f); - expect_token(f, Token_Colon); - tag = parse_simple_stmt(f); open = expect_token(f, Token_OpenBrace); AstNode *list = NULL; @@ -2315,7 +2315,6 @@ AstNode *parse_match_stmt(AstFile *f) { close = expect_token(f, Token_CloseBrace); body = make_block_stmt(f, list, list_count, open, close); - tag = convert_stmt_to_expr(f, tag, make_string("type match expression")); return make_type_match_stmt(f, token, tag, var, body); } else { if (f->cursor[0].kind != Token_OpenBrace) { |