diff options
| author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2020-04-01 16:28:28 +0200 |
|---|---|---|
| committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2020-05-21 17:27:45 +0200 |
| commit | 93ec535db78b56aa1dda92f5754126caff1d6ef6 (patch) | |
| tree | 4c7e8153414b239c2d4ee11da34104339bf038d3 /expression.c | |
| parent | 06c0531322a54e532eb3b9155bbf9f51adca0492 (diff) | |
| download | sparse-dev-93ec535db78b56aa1dda92f5754126caff1d6ef6.tar.gz | |
scope: move scope opening/ending inside compound_statement()
A compound statement starts and ends a block scope, so
it's better to start & end this scope inside the function
parsing the statement: compound_statement.
The only exception is for the body of a function where
the scope also enclose the parameter declaration but that
is fine since the function is special anyway.
Move the calls to start & close the block scope inside
compound_statement() and directly call statement_list()
for the function body.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'expression.c')
| -rw-r--r-- | expression.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/expression.c b/expression.c index 5b9bddfe..78e577cf 100644 --- a/expression.c +++ b/expression.c @@ -71,9 +71,7 @@ struct token *parens_expression(struct token *token, struct expression **expr, c struct statement *stmt = alloc_statement(token->pos, STMT_COMPOUND); *expr = e; e->statement = stmt; - start_symbol_scope(); token = compound_statement(token->next, stmt); - end_symbol_scope(); token = expect(token, '}', "at end of statement expression"); } else token = parse_expression(token, expr); |
