diff options
author | dec05eba <dec05eba@protonmail.com> | 2019-06-24 05:14:07 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2020-07-25 14:36:46 +0200 |
commit | 33223c7d9a80e821bccce25960f7e48ab425d975 (patch) | |
tree | 8ac99827261dbc935198ac467212b7ce41cf925e /src/parser.c | |
parent | abe41cc2d5413faa8adeb16831f654435b6d0ef0 (diff) |
Fix errors from pedantic check
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)); |