From bc1b73ef920246f8de5ca5b7fc8961d91a774664 Mon Sep 17 00:00:00 2001 From: Brendan Hansen Date: Thu, 8 Feb 2024 16:03:25 -0600 Subject: [PATCH] fixed: optional semicolons on naked return statement --- compiler/src/parser.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/src/parser.c b/compiler/src/parser.c index a2aee9e4..e3979118 100644 --- a/compiler/src/parser.c +++ b/compiler/src/parser.c @@ -1663,7 +1663,7 @@ static AstReturn* parse_return_stmt(OnyxParser* parser) { AstTyped* expr = NULL; - if (parser->curr->type != ';') { + if (parser->curr->type != ';' && parser->curr->type != Token_Type_Inserted_Semicolon) { expr = parse_compound_expression(parser, 0); if (expr == NULL || expr == (AstTyped *) &error_node) { @@ -2363,6 +2363,7 @@ static AstStructType* parse_struct(OnyxParser* parser) { if (parse_possible_tag(parser)) { consume_token_if_next(parser, ';'); + continue; } if (parse_possible_directive(parser, "persist")) { -- 2.25.1