Open finnperl opened 9 years ago
Confirmed in PPI 1.220 and on my development branches.
ppidump '"a".1'
PPI::Document
PPI::Statement
[ 1, 1, 1 ] PPI::Token::Quote::Double '"a"'
[ 1, 4, 4 ] PPI::Token::Number::Float '.1'
Thank you for your report
I wanted to report this since I find this module very useful Example code:
use PPI; use Data::Dumper; print Dumper(PPI::Document->new(\'"a".1'));
The output is:
$VAR1 = bless( { 'readonly' => '', 'children' => [ bless( { 'children' => [ bless( { 'separator' => '"', 'content' => '"a"' }, 'PPI::Token::Quote::Double' ), bless( { 'content' => '.1' }, 'PPI::Token::Number::Float' ) ] }, 'PPI::Statement' ) ], 'tab_width' => 1 }, 'PPI::Document' );
However, for example
perl -e 'print "a".1'
outputs a1, which implies that perl is able to detect . as the concat operator. Looking at the tokenizer, it seems that PPI does not look backwards when it is checking whether . is an operator or part of a float.