From e6b9efe850e920eac01402bb406689ccacf5b7b3 Mon Sep 17 00:00:00 2001 From: Christoffer Lerno Date: Sun, 18 Jul 2021 13:44:07 +0200 Subject: [PATCH] Fixing parse of error type. --- src/compiler/parse_expr.c | 1 + test/test_suite/errors/error_union.c3 | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 100644 test/test_suite/errors/error_union.c3 diff --git a/src/compiler/parse_expr.c b/src/compiler/parse_expr.c index 06e38db3b..170dd0b89 100644 --- a/src/compiler/parse_expr.c +++ b/src/compiler/parse_expr.c @@ -1120,6 +1120,7 @@ ParseRule rules[TOKEN_EOF + 1] = { [TOKEN_QUAD] = { parse_type_identifier, NULL, PREC_NONE }, [TOKEN_VOID] = { parse_type_identifier, NULL, PREC_NONE }, [TOKEN_TYPEID] = { parse_type_identifier, NULL, PREC_NONE }, + [TOKEN_ERR] = { parse_type_identifier, NULL, PREC_NONE }, [TOKEN_ELSE] = { NULL, parse_else_expr, PREC_TRY_ELSE }, [TOKEN_QUESTION] = { NULL, parse_ternary_expr, PREC_TERNARY }, diff --git a/test/test_suite/errors/error_union.c3 b/test/test_suite/errors/error_union.c3 new file mode 100644 index 000000000..41014a270 --- /dev/null +++ b/test/test_suite/errors/error_union.c3 @@ -0,0 +1,8 @@ +module foo; + +error Blurg; + +func void main() +{ + error foo; +} \ No newline at end of file