diff options
Diffstat (limited to 'parse.c')
-rw-r--r-- | parse.c | 13 |
1 files changed, 6 insertions, 7 deletions
@@ -2555,11 +2555,7 @@ static struct token *statement(struct token *token, struct statement **tree) } if (match_op(token, '{')) { - stmt->type = STMT_COMPOUND; - start_symbol_scope(); token = compound_statement(token->next, stmt); - end_symbol_scope(); - return expect(token, '}', "at end of compound statement"); } @@ -2666,7 +2662,10 @@ static struct token *parameter_type_list(struct token *token, struct symbol *fn) struct token *compound_statement(struct token *token, struct statement *stmt) { + stmt->type = STMT_COMPOUND; + start_symbol_scope(); token = statement_list(token, &stmt->stmts); + end_symbol_scope(); return token; } @@ -2818,15 +2817,15 @@ static struct token *parse_function_body(struct token *token, struct symbol *dec decl->ctype.modifiers |= MOD_EXTERN; stmt = start_function(decl); - *p = stmt; + FOR_EACH_PTR (base_type->arguments, arg) { declare_argument(arg, base_type); } END_FOR_EACH_PTR(arg); - token = compound_statement(token->next, stmt); - + token = statement_list(token->next, &stmt->stmts); end_function(decl); + if (!(decl->ctype.modifiers & MOD_INLINE)) add_symbol(list, decl); check_declaration(decl); |