diff options
author | Chip Salzenberg <chip@atlantic.net> | 1996-12-19 16:11:04 +1200 |
---|---|---|
committer | Chip Salzenberg <chip@atlantic.net> | 1996-12-20 11:14:00 +1200 |
commit | e0bef290662a8effcfd97306a4cca7327d4afe8a (patch) | |
tree | 038f5acc41af0871dccef39ac64b5a8e9a91f3b6 /toke.c | |
parent | f2f8ca5cb610536301ae36c7b4b93a2fb345342e (diff) | |
download | perl-e0bef290662a8effcfd97306a4cca7327d4afe8a.tar.gz |
Disallow labels named q, qq, qw, qx, s, y, and tr
Diffstat (limited to 'toke.c')
-rw-r--r-- | toke.c | 15 |
1 files changed, 11 insertions, 4 deletions
@@ -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 */ |