diff options
Diffstat (limited to 'src/parser.c')
-rw-r--r-- | src/parser.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/parser.c b/src/parser.c index c0d2c6d..68d0648 100644 --- a/src/parser.c +++ b/src/parser.c @@ -296,7 +296,6 @@ static void parser_parse_function_args(Parser *self, FunctionCall *func_call) { for(;;) { Ast *arg_expr; bool is_end_token; - arg_expr = NULL; throw_if_error(tokenizer_consume_if(&self->tokenizer, TOK_CLOSING_PAREN, &is_end_token)); if(is_end_token) @@ -638,7 +637,11 @@ Ast* parser_parse_body(Parser *self) { lhs_expr = parser_parse_declaration_lhs(self); if(lhs_expr) { + FunctionDecl *func_decl; + StructDecl *struct_decl; + Import *import; bool match; + throw_if_error(ast_create(self->allocator, lhs_expr, AST_LHS, &result)); if(lhs_expr->is_extern) { throw_if_error(tokenizer_accept(&self->tokenizer, TOK_SEMICOLON)); @@ -651,10 +654,6 @@ Ast* parser_parse_body(Parser *self) { throw_if_error(tokenizer_accept(&self->tokenizer, TOK_EQUALS)); - FunctionDecl *func_decl; - StructDecl *struct_decl; - Import *import; - func_decl = parser_parse_closure(self); if(func_decl) { throw_if_error(ast_create(self->allocator, func_decl, AST_FUNCTION_DECL, &lhs_expr->rhs_expr)); |