summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2009-07-28 09:47:24 +0200
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2009-07-29 09:20:16 +0200
commitf71d6157c7933c0d3df645f0411d97d7e2b66b2f (patch)
treece6b1df0d1a07956de3c4dffaff9d3382c7264ae /toke.c
parent0409250f9c9eac87ff80d18e21856800e91763b5 (diff)
downloadperl-f71d6157c7933c0d3df645f0411d97d7e2b66b2f.tar.gz
Forbid labels with keyword names
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/toke.c b/toke.c
index 658d163fcd..554975a661 100644
--- a/toke.c
+++ b/toke.c
@@ -5275,6 +5275,9 @@ Perl_yylex(pTHX)
while (d < PL_bufend && isSPACE(*d))
d++; /* no comments skipped here, or s### is misparsed */
+ /* Check for keywords */
+ tmp = keyword(PL_tokenbuf, len, 0);
+
/* Is this a label? */
if (!tmp && PL_expect == XSTATE
&& d < PL_bufend && *d == ':' && *(d + 1) != ':') {
@@ -5284,9 +5287,6 @@ Perl_yylex(pTHX)
TOKEN(LABEL);
}
- /* Check for keywords */
- tmp = keyword(PL_tokenbuf, len, 0);
-
/* Is this a word before a => operator? */
if (*d == '=' && d[1] == '>') {
CLINE;