Subject: | /x mode end-of-line comments are not recognized |
Date: | Fri, 25 Sep 2015 21:51:01 +0200 |
To: | bug-PPIx-Regexp [...] rt.cpan.org |
From: | Klaus Rindfrey <k-rindfrey [...] gmx.de> |
Hi Thomas,
i installed version 0.041 of PPIx::Regexp from CPAN. Now, the docu of
PPIx::Regexp::Token::Comment tells "This class represents a comment -
both parenthesized comments (i.e. (?# this is a comment ) and the /x
mode end-of-line comments."
But running this script:
#-----------------------------------
use strict;
use warnings;
use PPIx::Regexp;
use PPIx::Regexp::Dumper;
my $re = PPIx::Regexp->new(<<'EOT');
qr/foo
bar (?# first)
baz # second
/x'
EOT
PPIx::Regexp::Dumper->new( $re )->print();
#-----------------------------------
only the "(?# first)" comment is recognized, not the "# second". The
script prints:
#-----------------------------------
PPIx::Regexp failures=0
PPIx::Regexp::Token::Structure 'qr'
PPIx::Regexp::Structure::Regexp / ... '
PPIx::Regexp::Token::Literal 'f'
PPIx::Regexp::Token::Literal 'o'
PPIx::Regexp::Token::Literal 'o'
PPIx::Regexp::Token::Literal '
'
PPIx::Regexp::Token::Literal ' '
PPIx::Regexp::Token::Literal 'b'
PPIx::Regexp::Token::Literal 'a'
PPIx::Regexp::Token::Literal 'r'
PPIx::Regexp::Token::Literal ' '
PPIx::Regexp::Token::Comment '(?# first)'
PPIx::Regexp::Token::Literal '
'
PPIx::Regexp::Token::Literal ' '
PPIx::Regexp::Token::Literal 'b'
PPIx::Regexp::Token::Literal 'a'
PPIx::Regexp::Token::Literal 'z'
PPIx::Regexp::Token::Literal ' '
PPIx::Regexp::Token::Literal ' '
PPIx::Regexp::Token::Literal '#'
PPIx::Regexp::Token::Literal ' '
PPIx::Regexp::Token::Literal 's'
PPIx::Regexp::Token::Literal 'e'
PPIx::Regexp::Token::Literal 'c'
PPIx::Regexp::Token::Literal 'o'
PPIx::Regexp::Token::Literal 'n'
PPIx::Regexp::Token::Literal 'd'
PPIx::Regexp::Token::Literal '
'
PPIx::Regexp::Token::Literal '/'
PPIx::Regexp::Token::Literal 'x'
PPIx::Regexp::Token::Modifier ''
PPIx::Regexp::Token::Whitespace '
#-----------------------------------
I'm running perl v5.20.1.
Regards,
Klaus
Message body is not shown because sender requested not to inline it.
Message body is not shown because sender requested not to inline it.