commit b2cc565d9b38feb95d42fa044b1038e52335cd1e
Author:     Roberto E. Vargas Caballero <[email protected]>
AuthorDate: Mon Oct 19 21:13:32 2015 +0200
Commit:     Roberto E. Vargas Caballero <[email protected]>
CommitDate: Mon Oct 19 21:13:32 2015 +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.

diff --git a/cc1/stmt.c b/cc1/stmt.c
index 005b3b4..c824d29 100644
--- 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;

Reply via email to