From 33223c7d9a80e821bccce25960f7e48ab425d975 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Mon, 24 Jun 2019 05:14:07 +0200 Subject: Fix errors from pedantic check --- src/parser.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/parser.c') 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)); -- cgit v1.2.3