[hackers] [scc] Fix grammar error in stmtexp() || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Mon, 19 Oct 2015 21:15:39 +0200 (CEST)

commit b2cc565d9b38feb95d42fa044b1038e52335cd1e
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Mon Oct 19 21:13:32 2015 +0200
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
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
_AT_@ -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;
Received on Mon Oct 19 2015 - 21:15:39 CEST

This archive was generated by hypermail 2.3.0 : Mon Oct 19 2015 - 21:24:11 CEST