summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2013-10-22 16:48:16 +0100
committerDavid Mitchell <davem@iabyn.com>2013-10-22 17:01:30 +0100
commit46879fadd034dcb5d6f720076845767f8ccf152d (patch)
tree0c165f352ef17b1fac2e665cc83118421961886b /toke.c
parentfcbc518d7ac7875b7f443e72caf15fd07ab023a6 (diff)
downloadperl-46879fadd034dcb5d6f720076845767f8ccf152d.tar.gz
spurious "Use of "-x" without parentheses" mesg
RT #120288. Something like '-X' at the start of a line (where X is one char, but not a filetest operator) was giving a spurious Warning: Use of "-a" without parentheses is ambiguous error. This was because the toker was provisionally marking the -a as the last encountered unary operator (PL_last_uni), then not unmarking it when it found that that it wasn't in fact a filetest operator.
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/toke.c b/toke.c
index eb9d71fcd5..0f169a2b62 100644
--- a/toke.c
+++ b/toke.c
@@ -5708,7 +5708,6 @@ Perl_yylex(pTHX)
DEBUG_T( { printbuf("### Saw unary minus before =>, forcing word %s\n", s); } );
OPERATOR('-'); /* unary minus */
}
- PL_last_uni = PL_oldbufptr;
switch (tmp) {
case 'r': ftst = OP_FTEREAD; break;
case 'w': ftst = OP_FTEWRITE; break;
@@ -5747,6 +5746,7 @@ Perl_yylex(pTHX)
break;
}
if (ftst) {
+ PL_last_uni = PL_oldbufptr;
PL_last_lop_op = (OPCODE)ftst;
DEBUG_T( { PerlIO_printf(Perl_debug_log,
"### Saw file test %c\n", (int)tmp);