diff options
author | A404M <ahmadmahmoudiprogrammer@gmail.com> | 2025-03-22 21:08:34 +0330 |
---|---|---|
committer | A404M <ahmadmahmoudiprogrammer@gmail.com> | 2025-03-22 21:08:34 +0330 |
commit | 8d56cd69d565ad32467281dd36fd33ec48f32f61 (patch) | |
tree | 738242c562bf3bd60ae349e40e4a92507d17c336 /src | |
parent | 62cd39836fd1237c5f432a629542eb511e5f9cb7 (diff) |
some reordering
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/ast-tree.c | 10 | ||||
-rw-r--r-- | src/compiler/parser.c | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/compiler/ast-tree.c b/src/compiler/ast-tree.c index 890d159..111265f 100644 --- a/src/compiler/ast-tree.c +++ b/src/compiler/ast-tree.c @@ -1176,11 +1176,6 @@ AstTree *astTreeParseFunction(ParserNode *parserNode, AstTreeHelper *p_helper) { .globalDeps = p_helper->globalDeps, }; - if ((function->returnType = - astTreeParse(node_metadata->returnType, &helper)) == NULL) { - goto RETURN_ERROR; - } - for (size_t i = 0; i < node_arguments->size; ++i) { ParserNode *arg = node_arguments->data[i]; if (arg->token == PARSER_TOKEN_SYMBOL_COMMA) { @@ -1212,6 +1207,11 @@ AstTree *astTreeParseFunction(ParserNode *parserNode, AstTreeHelper *p_helper) { } } + if ((function->returnType = + astTreeParse(node_metadata->returnType, &helper)) == NULL) { + goto RETURN_ERROR; + } + for (size_t i = 0; i < body->size; ++i) { ParserNode *node = body->data[i]; switch (node->token) { diff --git a/src/compiler/parser.c b/src/compiler/parser.c index 08f262c..9d77462 100644 --- a/src/compiler/parser.c +++ b/src/compiler/parser.c @@ -146,7 +146,7 @@ static constexpr ParserOrder PARSER_ORDER[] = { }, { .ltr = false, - ORDER_ARRAY(LEXER_TOKEN_KEYWORD_IF,LEXER_TOKEN_KEYWORD_WHILE, ), + ORDER_ARRAY(LEXER_TOKEN_KEYWORD_IF, LEXER_TOKEN_KEYWORD_WHILE, ), }, }; |