diff options
Diffstat (limited to 'src/compiler')
-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, ), }, }; |