diff --git a/src/compiler/parse_global.c b/src/compiler/parse_global.c index 72217f0cd..39750a96c 100644 --- a/src/compiler/parse_global.c +++ b/src/compiler/parse_global.c @@ -1466,7 +1466,7 @@ static bool parse_macro_arguments(Context *context, Visibility visibility, Decl } // TODO use the body param. } - TRY_CONSUME(TOKEN_RPAREN, false); + CONSUME_OR(TOKEN_RPAREN, false); return true; } diff --git a/test/test_suite/regression/crash_on_right_paren_macro.c3 b/test/test_suite/regression/crash_on_right_paren_macro.c3 new file mode 100644 index 000000000..9605bf231 --- /dev/null +++ b/test/test_suite/regression/crash_on_right_paren_macro.c3 @@ -0,0 +1,6 @@ +macro void hello($b$Bar x; // #error: Expected ')' + @hello(1); + var $foo = 1; + $foo; + FOO; +}