harec

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit baae29bff5e6bf792eee373a4a53931b9fe7f2a3
parent f5f932d9c15fb8a2ee31f9872e4f58d32edc0407
Author: Drew DeVault <sir@cmpwn.com>
Date:   Tue, 29 Dec 2020 10:12:15 -0500

parse: remove shadowed tok variable

Reminder that case branches do not have their own scope

Diffstat:
Msrc/parse.c | 3+--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/parse.c b/src/parse.c @@ -847,7 +847,7 @@ parse_plain_expression(struct parser *par) { trace(TR_PARSE, "plain"); - struct token tok; + struct token tok = {0}; struct ast_expression *exp; switch (lex(par->lex, &tok)) { // plain-expression @@ -862,7 +862,6 @@ parse_plain_expression(struct parser *par) unlex(par->lex, &tok); struct identifier ident = {0}; parse_identifier(par, &ident); - struct token tok = {0}; switch (lex(par->lex, &tok)) { case T_LBRACE: unlex(par->lex, &tok);