scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

commit 416480154b86845ffec424db50b98ee1ff785e0a
parent 7b7b7b0bf8036a8027e8215b9fba5450c517c215
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Mon, 30 Dec 2024 11:22:06 +0100

cc1: Simplify loop

Diffstat:
Msrc/cmd/scc-cc/cc1/stmt.c | 5+----
1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/src/cmd/scc-cc/cc1/stmt.c b/src/cmd/scc-cc/cc1/stmt.c @@ -367,11 +367,8 @@ compound(Symbol *lbreak, Symbol *lcont, Switch *lswitch) error("too many nesting levels of compound statements"); ++nested; - for (;;) { - if (yytoken == '}') - break; + while (yytoken != '}') blockit(lbreak, lcont, lswitch); - } --nested; popctx();