Subject: | mis-parse of negation -POSIX::DBL_MAX() |
Date: | Sun, 21 Mar 2010 09:18:18 +1100 |
To: | bug-PPI [...] rt.cpan.org |
From: | Kevin Ryde <user42 [...] zip.com.au> |
In the debian packaged ppi 1.209 and perl 5.10.1, an input
return -POSIX::DBL_MAX()
is parsed as
PPI::Document
PPI::Statement::Break
[ 1, 1, 1 ] PPI::Token::Word 'return'
[ 1, 8, 8 ] PPI::Token::Word '-POSIX'
[ 1, 14, 14 ] PPI::Token::Word '::DBL_MAX'
PPI::Structure::List ( ... )
where I expected it to be a negation of the whole "POSIX::DBL_MAX",
something like the following, which I believe is how perl parses and
runs it (irrespective whether a prototype for that func is available
when it compiles).
PPI::Document
PPI::Statement::Break
[ 1, 1, 1 ] PPI::Token::Word 'return'
[ 1, 8, 8 ] PPI::Token::Operator '-'
[ 1, 10, 10 ] PPI::Token::Word 'POSIX::DBL_MAX'
PPI::Structure::List ( ... )