summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorChip Salzenberg <chip@atlantic.net>1996-12-19 16:11:04 +1200
committerChip Salzenberg <chip@atlantic.net>1996-12-20 11:14:00 +1200
commite0bef290662a8effcfd97306a4cca7327d4afe8a (patch)
tree038f5acc41af0871dccef39ac64b5a8e9a91f3b6 /toke.c
parentf2f8ca5cb610536301ae36c7b4b93a2fb345342e (diff)
downloadperl-e0bef290662a8effcfd97306a4cca7327d4afe8a.tar.gz
Disallow labels named q, qq, qw, qx, s, y, and tr
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/toke.c b/toke.c
index 2ebb0c2b16..4c79d7b33a 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 */