scc

simple C compiler
git clone git://git.2f30.org/scc
Log | Files | Refs | README | LICENSE

commit b2cc565d9b38feb95d42fa044b1038e52335cd1e
parent 398df28c10917d7e9e07f6d02c234a582ac94122
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Mon, 19 Oct 2015 21:13:32 +0200

Fix grammar error in stmtexp()

Stmtex() was doing a look ahead always, to detect
the situation of a labelled statement, but the
look ahead must be done only if the stmt begins
with an identifier.

Diffstat:
Mcc1/stmt.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cc1/stmt.c b/cc1/stmt.c @@ -40,7 +40,7 @@ stmtexp(Symbol *lbreak, Symbol *lcont, Caselist *lswitch) { if (accept(';')) return; - if (ahead() == ':') { + if (yytoken == IDEN && ahead() == ':') { label(); stmt(lbreak, lcont, lswitch); return;