fixed: parsing of compound results in quick functions
authorBrendan Hansen <brendan.f.hansen@gmail.com>
Tue, 6 Feb 2024 17:30:56 +0000 (11:30 -0600)
committerBrendan Hansen <brendan.f.hansen@gmail.com>
Tue, 6 Feb 2024 17:30:56 +0000 (11:30 -0600)
compiler/src/parser.c
core/runtime/info/global_tags.onyx

index bec7ef9e415082569616c2099fc99c79e5bc8219..a2aee9e411416cae239068d75285744e87e3e8ba 100644 (file)
@@ -190,12 +190,6 @@ static b32 next_tokens_are(OnyxParser* parser, i32 n, ...) {
         TokenType expected_type = va_arg(va, TokenType);
         OnyxToken *peeked_token = peek_token(i + skipped);
 
-        // if (peeked_token->type == Token_Type_Inserted_Semicolon) {
-        //     i--;
-        //     skipped += 1;
-        //     continue;
-        // }
-
         if (peeked_token->type != expected_type) {
             matched = 0;
             break;
@@ -3235,7 +3229,7 @@ static b32 parse_possible_quick_function_definition(OnyxParser* parser, AstTyped
         return_type = (AstType *) &basic_type_auto_return;
 
     } else {
-        AstTyped* body = parse_compound_expression(parser, 0);
+        AstTyped* body = parse_expression(parser, 0);
         if (body == NULL) {
             onyx_report_error(parser->curr->pos, Error_Critical, "Expected an expression here.");
             parser->hit_unexpected_token = 1;
index 0e5db7c68b5c02732226d2a93537c6ba3c900b97..c7a91ee98b8857d72b0626857e7ef168c7a4cef7 100644 (file)
@@ -27,7 +27,7 @@ get_globals_with_tag :: ($tag_type: type_expr) -> [] GGWT_Result(tag_type) {
                 data = glob.data,
                 type = glob.type,
                 tag = cast(&tag_type) tag.data,
-                pack = glob.pack
+                pack = glob.pack,
             });
         });
     }