From: Chip Salzenberg <chip@atlantic.net>
Date: Thu, 19 Dec 1996 04:11:04 +0000 (+1200)
Subject: Disallow labels named q, qq, qw, qx, s, y, and tr
X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e0bef290662a8effcfd97306a4cca7327d4afe8a;p=p5sagit%2Fp5-mst-13.2.git

Disallow labels named q, qq, qw, qx, s, y, and tr
---

diff --git a/toke.c b/toke.c
index 2ebb0c2..4c79d7b 100644
--- a/toke.c
+++ b/toke.c
@@ -2344,10 +2344,17 @@ yylex()
 
 	/* Is this a label? */
 	if (expect == XSTATE && d < bufend && *d == ':' && *(d + 1) != ':') {
-	    s = d + 1;
-	    yylval.pval = savepv(tokenbuf);
-	    CLINE;
-	    TOKEN(LABEL);
+	    if (len == 1 && strchr("syq", tokenbuf[0]) ||
+		len == 2 && ((tokenbuf[0] == 't' && tokenbuf[1] == 'r') ||
+			     (tokenbuf[0] == 'q' &&
+			      strchr("qwx", tokenbuf[1]))))
+		; /* no */
+	    else {
+		s = d + 1;
+		yylval.pval = savepv(tokenbuf);
+		CLINE;
+		TOKEN(LABEL);
+	    }
 	}
 
 	/* Check for keywords */