From: Brendan Hansen Date: Thu, 8 Feb 2024 22:03:25 +0000 (-0600) Subject: fixed: optional semicolons on naked return statement X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=bc1b73ef920246f8de5ca5b7fc8961d91a774664;p=onyx.git fixed: optional semicolons on naked return statement --- 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")) {