summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorLarry Wall <larry@wall.org>1999-10-06 02:55:57 -0700
committerGurusamy Sarathy <gsar@cpan.org>1999-10-08 02:31:13 +0000
commit2d2e263d835bab7638308fed2b56967f4815cad6 (patch)
treee51fc6f58005128ecbea0cb280149a4d15e0e0d6 /toke.c
parent0a30450eff33ad0d9a30d3e5e9e92dce35ee33b7 (diff)
downloadperl-2d2e263d835bab7638308fed2b56967f4815cad6.tar.gz
add suggested patch =~ s/NOTOP/OP_NOT/ with tests
Message-Id: <199910061655.JAA11333@kiev.wall.org> Subject: Re: [ID 19991001.004] apparent parsing error with not(arg) p4raw-id: //depot/perl@4312
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/toke.c b/toke.c
index a6d364195d..58b82df8cf 100644
--- a/toke.c
+++ b/toke.c
@@ -120,7 +120,7 @@ int* yychar_pointer = NULL;
* LOOPX : loop exiting command (goto, last, dump, etc)
* FTST : file test operator
* FUN0 : zero-argument function
- * FUN1 : not used
+ * FUN1 : not used, except for not, which isn't a UNIOP
* BOop : bitwise or or xor
* BAop : bitwise and
* SHop : shift operator
@@ -4227,7 +4227,10 @@ Perl_yylex(pTHX)
OPERATOR(USE);
case KEY_not:
- OPERATOR(NOTOP);
+ if (*s == '(' || (s = skipspace(s), *s == '('))
+ FUN1(OP_NOT);
+ else
+ OPERATOR(NOTOP);
case KEY_open:
s = skipspace(s);