summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorIan Goodacre <Ian.Goodacre@xtra.co.nz>2009-03-14 19:04:12 +1300
committerVincent Pit <perl@profvince.com>2009-03-14 12:56:02 +0100
commitdf3467db16fc4437950db94f0d3ad7ff8b2c9e46 (patch)
treef64144f82a655b2e386ca7edd0f3febc9142c889 /toke.c
parent43eb98159eec9ba37935203e5bf9f3a4199380c5 (diff)
downloadperl-df3467db16fc4437950db94f0d3ad7ff8b2c9e46.tar.gz
Return OPERATOR('[') for '[' without falling through to case '~', avoiding misinterpreting "[~" as an OP_SMARTMATCH.
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/toke.c b/toke.c
index 3c3e0ad2e2..8f5795a1b2 100644
--- a/toke.c
+++ b/toke.c
@@ -4287,7 +4287,10 @@ Perl_yylex(pTHX)
BOop(OP_BIT_XOR);
case '[':
PL_lex_brackets++;
- /* FALL THROUGH */
+ {
+ const char tmp = *s++;
+ OPERATOR(tmp);
+ }
case '~':
if (s[1] == '~'
&& (PL_expect == XOPERATOR || PL_expect == XTERMORDORDOR))