diff -Nru libppix-regexp-perl-0.085/Changes libppix-regexp-perl-0.086/Changes --- libppix-regexp-perl-0.085/Changes 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/Changes 2022-12-13 14:26:59.000000000 +0000 @@ -1,3 +1,14 @@ +0.086 2022-12-13 T. R. Wyant + Add width(), which returns the number of characters matched. Note + that an indefinite upper boumd is represented as IEEE 754 Inf if + that appears to be supported; otherwise by a singleton object + overloaded to allow stringification, numification, and numeric + tests. + + Use width() to enhance the detection of variable-width look-behinds. + + Serious clean-up on accepts_perl() subsystem. + 0.085 2022-04-16 T. R. Wyant Remove 'postderef' argument to PPIx::Regexp->new(). Postfix dereference is always recognized. diff -Nru libppix-regexp-perl-0.085/debian/changelog libppix-regexp-perl-0.086/debian/changelog --- libppix-regexp-perl-0.085/debian/changelog 2022-04-20 19:41:48.000000000 +0000 +++ libppix-regexp-perl-0.086/debian/changelog 2022-12-16 10:43:02.000000000 +0000 @@ -1,3 +1,10 @@ +libppix-regexp-perl (0.086-1) unstable; urgency=medium + + * Import upstream version 0.086. + * Declare compliance with Debian policy 4.6.1 + + -- Salvatore Bonaccorso Fri, 16 Dec 2022 11:43:02 +0100 + libppix-regexp-perl (0.085-1) unstable; urgency=medium * Import upstream version 0.085. diff -Nru libppix-regexp-perl-0.085/debian/control libppix-regexp-perl-0.086/debian/control --- libppix-regexp-perl-0.085/debian/control 2022-04-20 19:41:48.000000000 +0000 +++ libppix-regexp-perl-0.086/debian/control 2022-12-16 10:43:02.000000000 +0000 @@ -11,7 +11,7 @@ Build-Depends-Indep: liblist-moreutils-perl , libppi-perl (>= 1.238) , libtask-weaken-perl -Standards-Version: 4.6.0 +Standards-Version: 4.6.1 Vcs-Browser: https://salsa.debian.org/perl-team/modules/packages/libppix-regexp-perl Vcs-Git: https://salsa.debian.org/perl-team/modules/packages/libppix-regexp-perl.git Homepage: https://metacpan.org/release/PPIx-Regexp diff -Nru libppix-regexp-perl-0.085/eg/find-variable-length-lookarounds libppix-regexp-perl-0.086/eg/find-variable-length-lookarounds --- libppix-regexp-perl-0.085/eg/find-variable-length-lookarounds 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/eg/find-variable-length-lookarounds 2022-12-13 14:26:59.000000000 +0000 @@ -12,7 +12,7 @@ use PPI::Document; use PPIx::Regexp; -our $VERSION = '0.085'; +our $VERSION = '0.086'; my %opt; diff -Nru libppix-regexp-perl-0.085/eg/preaccepts libppix-regexp-perl-0.086/eg/preaccepts --- libppix-regexp-perl-0.085/eg/preaccepts 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/eg/preaccepts 2022-12-13 14:26:59.000000000 +0000 @@ -9,7 +9,7 @@ use Pod::Usage; use PPIx::Regexp; -our $VERSION = '0.085'; +our $VERSION = '0.086'; my %opt; diff -Nru libppix-regexp-perl-0.085/eg/predump libppix-regexp-perl-0.086/eg/predump --- libppix-regexp-perl-0.085/eg/predump 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/eg/predump 2022-12-13 14:26:59.000000000 +0000 @@ -21,7 +21,7 @@ use vars qw{ $VERSION }; -$VERSION = '0.085'; +$VERSION = '0.086'; my %opt = ( default_modifiers => [], @@ -41,7 +41,7 @@ indent=i locations! margin=i objectify! ordinal! perl_version|perl-version! ppi! short! significant! strict! - test! tokens! trace+ unescape! verbose+ + test! tokens! trace+ unescape! verbose width! + } ) and @ARGV or pod2usage( { @@ -313,6 +313,10 @@ This option displays the version of this script. The script then exits. +=item --width + +If true, this option causes the width of the object to be dumped. + =back =head1 SUPPORT diff -Nru libppix-regexp-perl-0.085/eg/preslurp libppix-regexp-perl-0.086/eg/preslurp --- libppix-regexp-perl-0.085/eg/preslurp 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/eg/preslurp 2022-12-13 14:26:59.000000000 +0000 @@ -14,7 +14,7 @@ use PPIx::Regexp::Dumper; use PPIx::Regexp::Tokenizer; -our $VERSION = '0.085'; +our $VERSION = '0.086'; my %opt = ( verbose => 0, @@ -39,6 +39,7 @@ if ( $opt{ignore} ) { my $fh = IO::File->new( $opt{ignore}, '<' ) or die "Unable to open $opt{ignore}: $!\n"; + local $_ = undef; # while (<>) ... does not localize $_. while ( <$fh> ) { s/ \s+ \z //smx; $_ or next; diff -Nru libppix-regexp-perl-0.085/inc/My/Module/Build.pm libppix-regexp-perl-0.086/inc/My/Module/Build.pm --- libppix-regexp-perl-0.085/inc/My/Module/Build.pm 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/inc/My/Module/Build.pm 2022-12-13 14:26:59.000000000 +0000 @@ -6,7 +6,7 @@ use Module::Build; our @ISA = qw{ Module::Build }; -our $VERSION = '0.085'; +our $VERSION = '0.086'; use Carp; diff -Nru libppix-regexp-perl-0.085/inc/My/Module/Meta.pm libppix-regexp-perl-0.086/inc/My/Module/Meta.pm --- libppix-regexp-perl-0.085/inc/My/Module/Meta.pm 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/inc/My/Module/Meta.pm 2022-12-13 14:26:59.000000000 +0000 @@ -158,6 +158,7 @@ 'Task::Weaken' => 0, 'base' => 0, 'constant' => 0, + 'overload' => 0, 'strict' => 0, 'warnings' => 0, @extra, diff -Nru libppix-regexp-perl-0.085/inc/My/Module/Mock_Tokenizer.pm libppix-regexp-perl-0.086/inc/My/Module/Mock_Tokenizer.pm --- libppix-regexp-perl-0.085/inc/My/Module/Mock_Tokenizer.pm 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/inc/My/Module/Mock_Tokenizer.pm 2022-12-13 14:26:59.000000000 +0000 @@ -7,7 +7,7 @@ use Carp; -our $VERSION = '0.085'; +our $VERSION = '0.086'; use constant ARRAY_REF => ref []; diff -Nru libppix-regexp-perl-0.085/inc/My/Module/Test.pm libppix-regexp-perl-0.086/inc/My/Module/Test.pm --- libppix-regexp-perl-0.085/inc/My/Module/Test.pm 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/inc/My/Module/Test.pm 2022-12-13 14:26:59.000000000 +0000 @@ -8,6 +8,7 @@ our @ISA = ( qw{ Exporter } ); use PPIx::Regexp; +use PPIx::Regexp::Constant qw{ INFINITY }; use PPIx::Regexp::Dumper; use PPIx::Regexp::Element; use PPIx::Regexp::Tokenizer; @@ -15,7 +16,7 @@ use Scalar::Util qw{ looks_like_number refaddr }; use Test::More 0.88; -our $VERSION = '0.085'; +our $VERSION = '0.086'; use constant ARRAY_REF => ref []; @@ -31,11 +32,13 @@ different done_testing dump_result + equals error fail false finis - equals + format_want + invocant is navigate note @@ -44,12 +47,15 @@ pass plan ppi + raw_width result replace_characters skip tokenize true value + width + INFINITY }; our @EXPORT = @EXPORT_OK; ## no critic (ProhibitAutomaticExportation) @@ -238,6 +244,15 @@ return is( $result, 0, 'Should be no leftover objects' ); } +sub format_want { + my ( $want ) = @_; + return _format_args( $want, bare => ref $want ? 0 : 1 ); +} + +sub invocant { + return $obj; +} + { my %array = map { $_ => 1 } qw{ @@ -315,6 +330,16 @@ return is( $result, $expect, "$kind $nav ppi() content '$safe'" ); } +sub raw_width { + my ( $min, $max, $name ) = @_; + defined $name + or $name = sprintf q<%s '%s'>, ref $obj, $obj->content(); + $Test::Builder::Level = $Test::Builder::Level + 1; + my @width = $obj->raw_width(); + return is( $width[0], $min, "$name raw minimum witdh" ) && is( + $width[1], $max, "$name raw maximum width" ); +} + sub replace_characters { %replace_characters = @_; return; @@ -363,7 +388,7 @@ } sub value { ## no critic (RequireArgUnpacking) - my ( $method, $args, $expect ) = @_; + my ( $method, $args, $want, $name ) = @_; ARRAY_REF eq ref $args or $args = [ $args ]; @@ -376,22 +401,35 @@ return ok( undef, "$class->$method() exists" ); } - $result = ARRAY_REF eq ref $expect ? + $result = ARRAY_REF eq ref $want ? [ $invocant->$method( @{ $args } ) ] : $invocant->$method( @{ $args } ); my $fmtd = _format_args( $args ); - my $answer = _format_args( [ $expect ], bare => 1 ); + my $answer = format_want( $want, bare => ref $want ? 0 : 1 ); + defined $name + or $name = "${class}->$method$fmtd is $answer"; if ( ref $result ) { - return is_deeply( $result, $expect, - "${class}->$method$fmtd is $answer" ); + return is_deeply( $result, $want, $name ); } else { - return is( $result, $expect, "${class}->$method$fmtd is $answer" ); + return is( $result, $want, $name ); } } +sub width { + my ( $min, $max, $name ) = @_; + defined $name + or $name = sprintf q<%s '%s'>, ref $obj, $obj->content(); + $Test::Builder::Level = $Test::Builder::Level + 1; + my @width = $obj->width(); + return is( $width[0], $min, "$name minimum witdh" ) && is( + $width[1], $max, "$name maximum width" ); +} + sub _format_args { my ( $args, %opt ) = @_; + ARRAY_REF eq ref $args + or $args = [ $args ]; my @rslt; foreach my $arg ( @{ $args } ) { if ( ! defined $arg ) { @@ -629,6 +667,13 @@ comparison as appropriate). If the first argument is omitted it defaults to the current object. +=head2 format_want + + is $got, $want, 'Want ' . format_want( $want ); + +This convenience subroutine formats the wanted result. If an ARRAY +reference, the contents are enclosed in parentheses. + =head2 false false( significant => [] ); @@ -644,6 +689,12 @@ should be held when it is run. It checks the number of objects in the internal C<%parent> hash, and succeeds if it is zero. +=head2 invocant + + invocant(); + +Returns the current object. + =head2 navigate navigate( snext_sibling => [] ); @@ -671,7 +722,7 @@ This subroutine is exported from L. -=head2 content +=head2 ppi ppi( '$foo' ); @@ -680,6 +731,19 @@ to the given string. If the current object is C or does not have a C method, the test fails. +=head2 raw_width + + raw_width( 0, undef, "Some title" ); + +This tests invokes the raw_width() method on the current object. The +arguments are the expected minimum width, the expected maximum width, +and a test title. The title defaults to the class and content of the +current object. + +Two tests are actually run. The titles of these will have +C<' raw minimum width'> and C<' raw maximum width'> appended. This +subroutine returns true if both tests pass. + =head2 result my $val = result(); @@ -722,7 +786,9 @@ value( max_capture_number => [], 3 ); This test succeeds if the given method, with the given arguments, called -on the current object, returns the given value. +on the current object, returns the given value. If the wanted value is +a reference, C is used for the comparison; otherwise +C is used. If the current object is undefined, the given method is called on the intended initial class, otherwise there would be no way to test the @@ -731,6 +797,23 @@ The result of the method call is accessable via the L subroutine. +An optional fourth argument specifies the name of the test. If this is +omitted or specified as C, a name is generated describing the +arguments. + +=head2 width + + width( 0, undef, "Some title" ); + +This tests invokes the width() method on the current object. The +arguments are the expected minimum width, the expected maximum width, +and a test title. The title defaults to the class and content of the +current object. + +Two tests are actually run. The titles of these will have +C<' minimum width'> and C<' maximum width'> appended. This subroutine +returns true if both tests pass. + =head1 SUPPORT Support is by the author. Please file bug reports at diff -Nru libppix-regexp-perl-0.085/lib/PPIx/Regexp/Constant.pm libppix-regexp-perl-0.086/lib/PPIx/Regexp/Constant.pm --- libppix-regexp-perl-0.085/lib/PPIx/Regexp/Constant.pm 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/lib/PPIx/Regexp/Constant.pm 2022-12-13 14:26:59.000000000 +0000 @@ -1,5 +1,103 @@ package PPIx::Regexp::Constant; +# Yes, I know this is horrible style. But I need a separate package for +# overloading to work, and I do *NOT* want stray files lying around if I +# end up ditching this mess. +package PPIx::Regexp::Constant::Inf; ## no critic (ProhibitMultiplePackages) + +use 5.006; + +use strict; +use warnings; + +use Carp; +use Scalar::Util qw{ refaddr }; + +our $VERSION = '0.086'; + +use overload + # Arithmetic + '+' => \&__preserve, + '-' => \&__subtract, + '*' => \&__preserve, + neg => \&__err_neg_inf, + # Comparison + '<=>' => \&__space_ship, + cmp => \&__cmp, + # Conversion + '""' => \&__stringify, + '0+' => \&__stringify, # For looks_like_number + bool => \&__bool, + # Catch all + nomethod => \&__bug_unimplemented, + ; + +{ + my $inf; + + # Scheduled block because __pos_inf() can be called at compile time. + BEGIN { + $inf = bless( \( my $x = 1 ), __PACKAGE__ ); + } + + sub __pos_inf { return $inf } + + sub __is_inf { return ref $_[0] && refaddr( $_[0] ) == refaddr( $inf ) } +} + +sub __bool { return 1 } + +sub __bug_unimplemented { + confess "Bug - Operation '$_[3]' is unimplemented"; +} + +sub __cmp { + my ( $x, $y, $swap ) = @_; + $swap + and return "$y" cmp "$x"; + return "$x" cmp "$y"; +} + +sub __err_nan { + croak 'NaN not supported'; +} + +sub __err_neg_inf { + croak 'Negative infinity not supported'; +} + +# Any operation that does not change the value +sub __preserve { return $_[0] }; + +sub __space_ship { + my ( undef, $y, $swap ) = @_; # We don't need our invocant + # Infinity is equal to itself + __is_inf( $y ) + and return 0; + # Any number is less than infinity + $swap + and return -1; + # Infinity is greater than any number + return 1; +} + +sub __stringify { + return 'Inf'; +} + +sub __subtract { + my ( $x, $y, $swap ) = @_; + __is_inf( $y ) + and __err_nan(); # Which croaks + $swap + and __err_neg_inf(); # Which croaks + return $x; +} + +1; + +package PPIx::Regexp::Constant; ## no critic (ProhibitMultiplePackages) + use strict; use warnings; @@ -8,7 +106,7 @@ # CAVEAT: do not include any other PPIx-Regexp modules in this one, or # you will end up with a circular dependency. -our $VERSION = '0.085'; +our $VERSION = '0.085_04'; our @EXPORT_OK = qw{ ARRAY_REF @@ -20,6 +118,7 @@ COOKIE_REGEX_SET FALSE HASH_REF + INFINITY LITERAL_LEFT_CURLY_ALLOWED LITERAL_LEFT_CURLY_REMOVED_PHASE_1 LITERAL_LEFT_CURLY_REMOVED_PHASE_2 @@ -123,6 +222,23 @@ use constant FALSE => 0; use constant TRUE => 1; +# This hack is because it appears that Strawberry Perl evaluates 0 + +# 'inf' as zero under Perl 5.12.3 and below. But the real problem is +# from a pure portability standpoint I can not count on IEEE 754 being +# in use. So if 0 + 'Inf' (documented in perldata) is zero or an error I +# fall back to an object that mimics its behavior to the extent I think +# I need. +# NOTE that the only way I have to test the ::Inf object is to comment +# out the eval{} code. This is ugly, but I can not think of anything +# better. +BEGIN { + local $@ = undef; + require constant; + constant->import( INFINITY => + eval { 0 + 'Inf' } || + PPIx::Regexp::Constant::Inf->__pos_inf() ); +} + use constant ARRAY_REF => ref []; use constant CODE_REF => ref sub {}; use constant HASH_REF => ref {}; @@ -268,10 +384,25 @@ The name of the cookie used to control regular expression sets. +=head2 FALSE + +A false value. The author makes no commitment what the exact value is, +only that Boolean operations will see it as false. + =head2 HASH_REF This is the result of C. +=head2 INFINITY + +This is the IEEE 754 value of C if that can be generated, or an +opaque overloaded object if not. Because the object does not (and I +think can not) implement the complete behavior of IEEE 754 C, this +manifest constant should only be used for stringification and numeric +comparison. Be aware that the numification of the object has to be the +same as its stringification to keep C happy. +B. + =head2 LITERAL_LEFT_CURLY_ALLOWED The Perl version at which allowed unescaped literal left curly brackets @@ -364,6 +495,11 @@ The name of the class that represents the unknown token. That is, L. +=head2 TRUE + +A true value. The author makes no commitment what the exact value is, +only that Boolean operations will see it as true. + =head2 VARIABLE_LENGTH_LOOK_BEHIND_INTRODUCED The version in which variable-length look-behinds were introduced. diff -Nru libppix-regexp-perl-0.085/lib/PPIx/Regexp/Dumper.pm libppix-regexp-perl-0.086/lib/PPIx/Regexp/Dumper.pm --- libppix-regexp-perl-0.085/lib/PPIx/Regexp/Dumper.pm 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/lib/PPIx/Regexp/Dumper.pm 2022-12-13 14:26:59.000000000 +0000 @@ -43,12 +43,13 @@ use PPIx::Regexp; use PPIx::Regexp::Constant qw{ ARRAY_REF + INFINITY @CARP_NOT }; use PPIx::Regexp::Tokenizer; use PPIx::Regexp::Util qw{ __choose_tokenizer_class __instance }; -our $VERSION = '0.085'; +our $VERSION = '0.086'; use constant LOCATION_WIDTH => 19; @@ -175,6 +176,10 @@ The default is zero. +=item width Boolean + +If true, this option causes a dump of the width of the object. + =back If the thing to be dumped was a string, unrecognized arguments are @@ -198,6 +203,7 @@ test => 0, tokens => 0, verbose => 0, + width => 0, ); sub new { @@ -448,6 +454,36 @@ return; } +sub _format_width_dump { + my @arg = @_; + foreach ( @arg ) { + if ( defined ) { + $_ == INFINITY + and $_ = q<'Inf'>; + } else { + $_ = 'undef'; + } + } + wantarray + and return @arg; + return join ', ', @arg; +} + +sub _format_width_test { + my @arg = @_; + foreach ( @arg ) { + if ( defined ) { + $_ == INFINITY + and $_ = 'INFINITY'; + } else { + $_ = 'undef'; + } + } + wantarray + and return @arg; + return join ', ', @arg; +} + sub _tokens_test { my ( $self, $elem ) = @_; @@ -531,6 +567,11 @@ $dumper->{locations} and substr $rslt[0], 0, 0, ' ' x LOCATION_WIDTH; + if ( $dumper->{width} ) { + my $width = _format_width_dump( $self->width() ); + $rslt[-1] .= "\t{ $width }"; + } + $dumper->{perl_version} and $rslt[-1] .= "\t" . $dumper->_perl_version( $self ); @@ -568,6 +609,14 @@ } + if ( $dumper->{width} ) { + my $raw = _format_width_test( $self->raw_width() ); + my $width = _format_width_test( $self->width() ); + push @rslt, + "raw_width( $raw );", + "width ( $width );"; + } + if ( $dumper->{perl_version} ) { foreach my $method ( qw{ perl_version_introduced @@ -624,6 +673,12 @@ $dumper->{perl_version} and push @rslt, $dumper->_perl_version( $self ); + + if ( $dumper->{width} ) { + my $width = _format_width_dump( $self->width() ); + push @rslt, "{ $width }"; + } + if ( $dumper->{verbose} ) { foreach my $method ( qw{ number name max_capture_number } ) { $self->can( $method ) or next; @@ -684,6 +739,15 @@ $dumper->_safe( $self->$method() ) . ' );'; } } + + if ( $dumper->{width} ) { + my $raw = _format_width_test( $self->raw_width() ); + my $width = _format_width_test( $self->width() ); + push @rslt, + "raw_width( $raw );", + "width ( $width );"; + } + foreach my $method ( qw{ start type finish } ) { my @eles = $self->$method(); push @rslt, 'choose ( ' . $dumper->__nav( @@ -752,6 +816,11 @@ } } + if ( $dumper->{width} ) { + my $width = _format_width_dump( $self->width() ); + push @rslt, "{ $width }"; + } + $dumper->{perl_version} and push @rslt, $dumper->_perl_version( $self ); @@ -836,6 +905,14 @@ } } + if ( $dumper->{width} ) { + my $raw = _format_width_test( $self->raw_width() ); + my $width = _format_width_test( $self->width() ); + push @rslt, + "raw_width( $raw );", + "width ( $width );"; + } + if ( $dumper->{verbose} ) { foreach my $method ( diff -Nru libppix-regexp-perl-0.085/lib/PPIx/Regexp/Element.pm libppix-regexp-perl-0.086/lib/PPIx/Regexp/Element.pm --- libppix-regexp-perl-0.085/lib/PPIx/Regexp/Element.pm 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/lib/PPIx/Regexp/Element.pm 2022-12-13 14:26:59.000000000 +0000 @@ -54,7 +54,7 @@ @CARP_NOT }; -our $VERSION = '0.085'; +our $VERSION = '0.086'; =head2 accepts_perl @@ -712,6 +712,27 @@ } } +=head2 raw_width + + my ( $raw_min, $raw_max ) = $self->raw_width(); + +This public method returns the minimum and maximum width matched by the +element before taking into account such details as what the element +actually is and how it is quantified. Either or both elements can be +C if the width can not be determined, and the maximum can be +C. + +This method was added in version 0.085_01. + +=cut + +# This implementation is appropriate to a structural element -- i.e. it +# returns C<( 0, 0 )>. + +sub raw_width { + return ( 0, 0 ); +} + =head2 remove_insignificant This method returns a new object manufactured from the invocant, but @@ -723,7 +744,7 @@ If you call this method on any other L class you will get back either the invocant or nothing. This may change to a -clone of the invocant or nothing if unforseen problems arise with +clone of the invocant or nothing if unforeseen problems arise with returning the invocant, or if objects become mutable (unlikely, but not impossible.) @@ -765,7 +786,7 @@ sub requirements_for_perl { my ( $self ) = @_; my @req; - foreach my $r ( @{ $self->__structured_requirements_for_perl() || [] } ) { + foreach my $r ( $self->__perl_requirements() ) { push @req, defined $r->{removed} ? "$r->{introduced} <= \$] < $r->{removed}" : "$r->{introduced} <= \$]"; @@ -932,56 +953,6 @@ return $source->statement(); } -# NOTE: This method is to be used ONLY for requirements_for_perl(). I -# _may_ eventually expose it, but at the moment I do not consider it -# stable. The exposure would be -# sub structured_requirements_for_perl { -# my ( $self ) = @_; -# return $self->__structured_requirements_for_perl(); -# } -# The return ia a reference to an array of hashes. Each hash contains -# key {introduced} (the version the element was introduced) and MAYBE -# key {removed} (the version the element was removed). There may be more -# than one such, and their ranges will not overlap. -sub __structured_requirements_for_perl { - my ( $self, $rslt ) = @_; - $rslt ||= $self->__structured_requirements_for_any_perl(); - - my @merged; - foreach my $left ( $self->__perl_requirements() ) { - foreach my $right ( @{ $rslt } ) { - my $min = max( $left->{introduced}, $right->{introduced} ); - my $max = defined $left->{removed} ? - defined $right->{removed} ? - min( $left->{removed}, $right->{removed} ) : - $left->{removed} : - $right->{removed}; - defined $max - and $max <= $min - and next; - push @merged, { - introduced => $min, - removed => $max, - }; - } - } - @{ $rslt } = @merged; - - return $rslt; -} - -# NOTE: This method is to be used ONLY to initialize -# __structured_requirements_for_perl(). It returns a structure that -# matches any Perl. -sub __structured_requirements_for_any_perl { - return [ - { - introduced => MINIMUM_PERL, - removed => undef, - }, - ]; -} - =head2 tokens This method returns all tokens contained in the element. @@ -1042,6 +1013,36 @@ return; } +=head2 width + + my ( $min, $max ) = $self->width(); + +This method returns the minimum and maximum number of characters this +element can match. + +Either element can be C if it cannot be determined. For example, +for C both elements will be C. Recursions will return +C because they can not be analyzed statically -- or at least I am +not smart enough to do so. Back references B return C if the +referred-to group can not be uniquely determined. + +It is possible for C<$max> to be C. For example, for C +C<$max> will be C. + +Elements that do not actually match anything will return zeroes. + +B This method was added because I wanted better detection of +variable-length look-behinds. Both it and L +(above) should be considered somewhat experimental. + +This method was added in version 0.085_01. + +=cut + +sub width { + return ( 0, 0 ); +} + =head2 nav This method returns navigation information from the top of the hierarchy diff -Nru libppix-regexp-perl-0.085/lib/PPIx/Regexp/Lexer.pm libppix-regexp-perl-0.086/lib/PPIx/Regexp/Lexer.pm --- libppix-regexp-perl-0.085/lib/PPIx/Regexp/Lexer.pm 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/lib/PPIx/Regexp/Lexer.pm 2022-12-13 14:26:59.000000000 +0000 @@ -69,7 +69,7 @@ use PPIx::Regexp::Tokenizer (); use PPIx::Regexp::Util qw{ __choose_tokenizer_class __instance }; -our $VERSION = '0.085'; +our $VERSION = '0.086'; =head2 new diff -Nru libppix-regexp-perl-0.085/lib/PPIx/Regexp/Node/Range.pm libppix-regexp-perl-0.086/lib/PPIx/Regexp/Node/Range.pm --- libppix-regexp-perl-0.085/lib/PPIx/Regexp/Node/Range.pm 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/lib/PPIx/Regexp/Node/Range.pm 2022-12-13 14:26:59.000000000 +0000 @@ -40,7 +40,7 @@ @CARP_NOT }; -our $VERSION = '0.085'; +our $VERSION = '0.086'; sub explain { my ( $self ) = @_; diff -Nru libppix-regexp-perl-0.085/lib/PPIx/Regexp/Node/Unknown.pm libppix-regexp-perl-0.086/lib/PPIx/Regexp/Node/Unknown.pm --- libppix-regexp-perl-0.085/lib/PPIx/Regexp/Node/Unknown.pm 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/lib/PPIx/Regexp/Node/Unknown.pm 2022-12-13 14:26:59.000000000 +0000 @@ -10,7 +10,7 @@ use PPIx::Regexp::Constant qw{ @CARP_NOT }; use PPIx::Regexp::Util; -our $VERSION = '0.085'; +our $VERSION = '0.086'; *__PPIX_ELEM__post_reblessing = \&PPIx::Regexp::Util::__post_rebless_error; diff -Nru libppix-regexp-perl-0.085/lib/PPIx/Regexp/Node.pm libppix-regexp-perl-0.086/lib/PPIx/Regexp/Node.pm --- libppix-regexp-perl-0.085/lib/PPIx/Regexp/Node.pm 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/lib/PPIx/Regexp/Node.pm 2022-12-13 14:26:59.000000000 +0000 @@ -37,19 +37,20 @@ use base qw{ PPIx::Regexp::Element }; use Carp; -use List::Util qw{ max }; +use List::Util qw{ max min }; use PPIx::Regexp::Constant qw{ CODE_REF FALSE + INFINITY MINIMUM_PERL NODE_UNKNOWN TRUE @CARP_NOT }; -use PPIx::Regexp::Util qw{ __instance }; +use PPIx::Regexp::Util qw{ __instance __merge_perl_requirements width }; use Scalar::Util qw{ refaddr }; -our $VERSION = '0.085'; +our $VERSION = '0.086'; use constant ELEMENT_UNKNOWN => NODE_UNKNOWN; @@ -68,28 +69,6 @@ return $self; } -sub accepts_perl { - my ( $self, $version ) = @_; - foreach my $elem ( $self->elements() ) { - $elem->accepts_perl( $version ) - or return FALSE; - } - return TRUE; -} - -# NOTE: this method is to be used ONLY for requirements_for_perl(). See -# PPIx::Regexp::Element for exposure plans. IF it is exposed, that is -# where it will be documented. -sub __structured_requirements_for_perl { - my ( $self, $rslt ) = @_; - $rslt ||= $self->__structured_requirements_for_any_perl(); - - foreach my $elem ( $self->elements() ) { - $elem->__structured_requirements_for_perl( $rslt ); - } - return $rslt; -} - =head2 child my $kid = $node->child( 0 ); @@ -511,6 +490,79 @@ return join '', map { $_->unescaped_content() } $self->elements(); } +use constant ALTERNATION => q<|>; + +{ + my $obj; + sub _alternation_object { + unless ( $obj ) { + +=begin comment + + # This is a pain because PPIx::Regexp::Token requires a + # tokenizer object. + require PPIx::Regexp::Tokenizer; + require PPIx::Regexp::Token::Operator; + $obj = PPIx::Regexp::Token::Operator->__new( + ALTERNATION, + tokenizer => PPIx::Regexp::Tokenizer->new( ALTERNATION ), + ); + +=end comment + +=cut + + # DANGER WILL ROBINSON! + # This is a horrible encapsulation violation, which I get + # away with because I am using the object as a sentinel. + + $obj = bless { + content => ALTERNATION, + }, 'PPIx::Regexp::Token::Operator'; + } + return $obj; + } +} + +sub raw_width { + my ( $self ) = @_; + return ( $self->__raw_width() )[ 0, 1 ]; +} + +# PRIVATE TO THIS PACKAGE. +# This is the machinery for raw_width(), but because the datum is needed +# internally it also returns the number of alternatives found. +sub __raw_width { + my ( $self ) = @_; + my ( $node_min, $node_max ) = ( INFINITY, 0 ); + my ( $raw_min, $raw_max ) = ( 0, 0 ); + my $alternatives = 0; + foreach my $elem ( $self->elements(), _alternation_object() ) { + if ( $elem->isa( 'PPIx::Regexp::Token::Operator' ) && + $elem->content() eq ALTERNATION + ) { + $alternatives++; + defined $node_min + and $node_min = defined $raw_min ? + min( $node_min, $raw_min ) : + undef; + $raw_min = 0; + defined $node_max + and $node_max = defined $raw_max ? + max( $node_max, $raw_max ) : + undef; + $raw_max = 0; + } else { + my ( $e_min, $e_max ) = $elem->width(); + defined $raw_min + and $raw_min = defined $e_min ? $raw_min + $e_min : undef; + defined $raw_max + and $raw_max = defined $e_max ? $raw_max + $e_max : undef; + } + } + return ( $node_min, $node_max, $alternatives ); +} + # Help for nav(); sub __nav { my ( $self, $child ) = @_; @@ -533,6 +585,50 @@ return 1; } +sub __perl_requirements { + my ( $self ) = @_; + unless ( $self->{perl_requirements} ) { + my @req = $self->__perl_requirements_setup(); + foreach my $kid ( $self->children() ) { + push @req, $kid->__perl_requirements(); + } + $self->{perl_requirements} = [ __merge_perl_requirements( @req ) ]; + } + return @{ $self->{perl_requirements} }; +} + +sub _token_order { + my ( $self ) = @_; + my $order = 0; + delete $self->{_token_order}; + foreach my $elem ( $self->tokens() ) { + $self->{_token_order}{ refaddr $elem } = $order++; + } + return; +} + +# Order two elements according to the position of their last tokens. The +# elements must both be descendants of the invocant or an exception is +# thrown. The return is equivalent to the space ship operator (<=>). +# +# For the moment at least this is private to the PPIx-Regexp package. +# It is needed by the width() functionality to (try to) determine which +# capture group a back reference refers to. +sub __token_post_order { + my ( $self, $left, $right ) = @_; + $self->{_token_order} + or $self->_token_order(); + my @order; + foreach ( $left, $right ) { + ref $_ + or confess 'Bug - Operand must be a PPIx::Regexp::Element'; + defined( my $inx = $self->{_token_order}{ refaddr( $_->last_token() ) } ) + or confess 'Bug - Operand not descendant of invocant'; + push @order, $inx; + } + return $order[0] <=> $order[1]; +} + # Called by the lexer once it has done its worst to all the tokens. # Called as a method with the lexer as argument. The return is the # number of parse failures discovered when finalizing. diff -Nru libppix-regexp-perl-0.085/lib/PPIx/Regexp/Structure/Assertion.pm libppix-regexp-perl-0.086/lib/PPIx/Regexp/Structure/Assertion.pm --- libppix-regexp-perl-0.085/lib/PPIx/Regexp/Structure/Assertion.pm 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/lib/PPIx/Regexp/Structure/Assertion.pm 2022-12-13 14:26:59.000000000 +0000 @@ -35,11 +35,13 @@ use base qw{ PPIx::Regexp::Structure }; use Carp qw{ confess }; +use List::Util qw{ max }; -our $VERSION = '0.085'; +our $VERSION = '0.086'; use PPIx::Regexp::Constant qw{ LITERAL_LEFT_CURLY_ALLOWED + VARIABLE_LENGTH_LOOK_BEHIND_INTRODUCED @CARP_NOT }; @@ -67,6 +69,32 @@ return $self->_get_type()->is_positive(); } +sub perl_version_introduced { + my ( $self ) = @_; + return( $self->{perl_version_introduced} ||= + $self->_perl_version_introduced() ); +} + +sub _perl_version_introduced { + my ( $self ) = @_; + my $ver = max( map { $_->perl_version_introduced() } + $self->children() ); + if ( $ver < VARIABLE_LENGTH_LOOK_BEHIND_INTRODUCED && + ! $self->is_look_ahead() + ) { + my ( $wid_min, $wid_max ) = $self->raw_width(); + defined $wid_min + and defined $wid_max + and $wid_min < $wid_max + and $ver = max( $ver, VARIABLE_LENGTH_LOOK_BEHIND_INTRODUCED ); + } + return $ver; +} + +sub width { + return ( 0, 0 ); +} + # An un-escaped literal left curly bracket can always follow this # element. sub __following_literal_left_curly_disallowed_in { diff -Nru libppix-regexp-perl-0.085/lib/PPIx/Regexp/Structure/Atomic_Script_Run.pm libppix-regexp-perl-0.086/lib/PPIx/Regexp/Structure/Atomic_Script_Run.pm --- libppix-regexp-perl-0.085/lib/PPIx/Regexp/Structure/Atomic_Script_Run.pm 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/lib/PPIx/Regexp/Structure/Atomic_Script_Run.pm 2022-12-13 14:26:59.000000000 +0000 @@ -9,7 +9,7 @@ use PPIx::Regexp::Constant qw{ @CARP_NOT }; -our $VERSION = '0.085'; +our $VERSION = '0.086'; 1; diff -Nru libppix-regexp-perl-0.085/lib/PPIx/Regexp/Structure/BranchReset.pm libppix-regexp-perl-0.086/lib/PPIx/Regexp/Structure/BranchReset.pm --- libppix-regexp-perl-0.085/lib/PPIx/Regexp/Structure/BranchReset.pm 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/lib/PPIx/Regexp/Structure/BranchReset.pm 2022-12-13 14:26:59.000000000 +0000 @@ -37,7 +37,7 @@ use Carp qw{ confess }; use PPIx::Regexp::Constant qw{ @CARP_NOT }; -our $VERSION = '0.085'; +our $VERSION = '0.086'; # Called by the lexer to record the capture number. sub __PPIX_LEXER__record_capture_number { diff -Nru libppix-regexp-perl-0.085/lib/PPIx/Regexp/Structure/Capture.pm libppix-regexp-perl-0.086/lib/PPIx/Regexp/Structure/Capture.pm --- libppix-regexp-perl-0.085/lib/PPIx/Regexp/Structure/Capture.pm 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/lib/PPIx/Regexp/Structure/Capture.pm 2022-12-13 14:26:59.000000000 +0000 @@ -37,7 +37,7 @@ use PPIx::Regexp::Constant qw{ @CARP_NOT }; -our $VERSION = '0.085'; +our $VERSION = '0.086'; sub explain { my ( $self ) = @_; diff -Nru libppix-regexp-perl-0.085/lib/PPIx/Regexp/Structure/CharClass.pm libppix-regexp-perl-0.086/lib/PPIx/Regexp/Structure/CharClass.pm --- libppix-regexp-perl-0.085/lib/PPIx/Regexp/Structure/CharClass.pm 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/lib/PPIx/Regexp/Structure/CharClass.pm 2022-12-13 14:26:59.000000000 +0000 @@ -38,9 +38,9 @@ LITERAL_LEFT_CURLY_REMOVED_PHASE_2 @CARP_NOT }; -use PPIx::Regexp::Util qw{ __instance }; +use PPIx::Regexp::Util qw{ :width_one __instance }; -our $VERSION = '0.085'; +our $VERSION = '0.086'; sub __new { my ( $class, @args ) = @_; diff -Nru libppix-regexp-perl-0.085/lib/PPIx/Regexp/Structure/Code.pm libppix-regexp-perl-0.086/lib/PPIx/Regexp/Structure/Code.pm --- libppix-regexp-perl-0.085/lib/PPIx/Regexp/Structure/Code.pm 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/lib/PPIx/Regexp/Structure/Code.pm 2022-12-13 14:26:59.000000000 +0000 @@ -41,7 +41,7 @@ use PPIx::Regexp::Constant qw{ @CARP_NOT }; -our $VERSION = '0.085'; +our $VERSION = '0.086'; # The only child of this structure should be a single # PPIx::Regexp::Token::Code. Anything else gets turned into the diff -Nru libppix-regexp-perl-0.085/lib/PPIx/Regexp/Structure/Main.pm libppix-regexp-perl-0.086/lib/PPIx/Regexp/Structure/Main.pm --- libppix-regexp-perl-0.085/lib/PPIx/Regexp/Structure/Main.pm 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/lib/PPIx/Regexp/Structure/Main.pm 2022-12-13 14:26:59.000000000 +0000 @@ -42,7 +42,7 @@ use PPIx::Regexp::Constant qw{ @CARP_NOT }; -our $VERSION = '0.085'; +our $VERSION = '0.086'; =head2 delimiters diff -Nru libppix-regexp-perl-0.085/lib/PPIx/Regexp/Structure/Modifier.pm libppix-regexp-perl-0.086/lib/PPIx/Regexp/Structure/Modifier.pm --- libppix-regexp-perl-0.085/lib/PPIx/Regexp/Structure/Modifier.pm 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/lib/PPIx/Regexp/Structure/Modifier.pm 2022-12-13 14:26:59.000000000 +0000 @@ -37,7 +37,7 @@ use PPIx::Regexp::Constant qw{ @CARP_NOT }; -our $VERSION = '0.085'; +our $VERSION = '0.086'; # This is a kluge for both determining whether the object asserts # modifiers (hence the 'ductype') and determining whether the given diff -Nru libppix-regexp-perl-0.085/lib/PPIx/Regexp/Structure/NamedCapture.pm libppix-regexp-perl-0.086/lib/PPIx/Regexp/Structure/NamedCapture.pm --- libppix-regexp-perl-0.085/lib/PPIx/Regexp/Structure/NamedCapture.pm 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/lib/PPIx/Regexp/Structure/NamedCapture.pm 2022-12-13 14:26:59.000000000 +0000 @@ -43,7 +43,7 @@ use PPIx::Regexp::Constant qw{ @CARP_NOT }; -our $VERSION = '0.085'; +our $VERSION = '0.086'; sub explain { my ( $self ) = @_; diff -Nru libppix-regexp-perl-0.085/lib/PPIx/Regexp/Structure/Quantifier.pm libppix-regexp-perl-0.086/lib/PPIx/Regexp/Structure/Quantifier.pm --- libppix-regexp-perl-0.085/lib/PPIx/Regexp/Structure/Quantifier.pm 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/lib/PPIx/Regexp/Structure/Quantifier.pm 2022-12-13 14:26:59.000000000 +0000 @@ -40,7 +40,10 @@ use base qw{ PPIx::Regexp::Structure }; +use Scalar::Util qw{ looks_like_number }; + use PPIx::Regexp::Constant qw{ + INFINITY LITERAL_LEFT_CURLY_ALLOWED MINIMUM_PERL MSG_LOOK_BEHIND_TOO_LONG @@ -49,7 +52,7 @@ @CARP_NOT }; -our $VERSION = '0.085'; +our $VERSION = '0.086'; sub can_be_quantified { return; @@ -57,6 +60,9 @@ sub explain { my ( $self ) = @_; + +=begin comment + my $content = $self->content(); if ( $content =~ m/ \A [{] ( .*? ) [}] \z /smx ) { my $quant = $1; @@ -80,12 +86,71 @@ return "match exactly $lo times"; } return $self->SUPER::explain(); + +=end comment + +=cut + + my ( $lo, $hi ) = $self->_min_max(); + + if ( looks_like_number( $hi ) ) { + $hi == INFINITY + and return "match $lo or more times"; + looks_like_number( $lo ) + and $lo == $hi + and return "match exactly $lo times"; + } elsif ( $lo eq $hi ) { + return "match $lo times"; + } + return "match $lo to $hi times"; +} + +sub _min_max { + my ( $self ) = @_; + my $content = $self->content(); + if ( $content =~ m/ \A [{] ( .*? ) [}] \z /smx ) { + my $quant = $1; + my ( $lo, $hi ) = split qr{ , }smx, $quant; + foreach ( $lo, $hi ) { + defined + or next; + s/ \A \s+ //smx; + s/ \s+ \z //smx; + } + defined $lo + and '' ne $lo + or $lo = 0; + defined $hi + and '' ne $hi + and return ( $lo, $hi ); + $quant =~ m/ , \z /smx + and return ( $lo, INFINITY ); + return ( $lo, $lo ); + } } sub is_quantifier { return 1; } +sub width { + return ( 0, 0 ); +} + +sub __quantified_width { + my ( $self, $raw_min, $raw_max ) = @_; + my ( $my_min, $my_max ) = $self->_min_max(); + foreach ( $my_min, $my_max ) { + looks_like_number( $_ ) + or $_ = undef; + } + defined $raw_min + and $raw_min = defined $my_min ? $raw_min * $my_min : undef; + defined $raw_max + and $raw_max = defined $my_max ? $raw_max * $my_max : undef; + return ( $raw_min, $raw_max ); +} + sub __following_literal_left_curly_disallowed_in { return LITERAL_LEFT_CURLY_ALLOWED; } @@ -135,14 +200,6 @@ } } - - # The problem I am having is that the dumper uses - # __structured_requirements_for_perl(), which is not - # sensitive to the minimum perl of structures, only - # elements. But there is no logical element to hang the - # minimum version on. Maybe the opening bracket is less bad - # than the other choices? - } } diff -Nru libppix-regexp-perl-0.085/lib/PPIx/Regexp/Structure/Regexp.pm libppix-regexp-perl-0.086/lib/PPIx/Regexp/Structure/Regexp.pm --- libppix-regexp-perl-0.085/lib/PPIx/Regexp/Structure/Regexp.pm 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/lib/PPIx/Regexp/Structure/Regexp.pm 2022-12-13 14:26:59.000000000 +0000 @@ -38,7 +38,7 @@ use PPIx::Regexp::Constant qw{ @CARP_NOT }; -our $VERSION = '0.085'; +our $VERSION = '0.086'; sub can_be_quantified { return; } diff -Nru libppix-regexp-perl-0.085/lib/PPIx/Regexp/Structure/RegexSet.pm libppix-regexp-perl-0.086/lib/PPIx/Regexp/Structure/RegexSet.pm --- libppix-regexp-perl-0.085/lib/PPIx/Regexp/Structure/RegexSet.pm 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/lib/PPIx/Regexp/Structure/RegexSet.pm 2022-12-13 14:26:59.000000000 +0000 @@ -10,7 +10,9 @@ @CARP_NOT }; -our $VERSION = '0.085'; +use PPIx::Regexp::Util qw{ :width_one }; + +our $VERSION = '0.086'; sub __following_literal_left_curly_disallowed_in { return LITERAL_LEFT_CURLY_REMOVED_PHASE_2; diff -Nru libppix-regexp-perl-0.085/lib/PPIx/Regexp/Structure/Replacement.pm libppix-regexp-perl-0.086/lib/PPIx/Regexp/Structure/Replacement.pm --- libppix-regexp-perl-0.085/lib/PPIx/Regexp/Structure/Replacement.pm 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/lib/PPIx/Regexp/Structure/Replacement.pm 2022-12-13 14:26:59.000000000 +0000 @@ -40,7 +40,7 @@ use PPIx::Regexp::Constant qw{ @CARP_NOT }; -our $VERSION = '0.085'; +our $VERSION = '0.086'; sub can_be_quantified { return; } diff -Nru libppix-regexp-perl-0.085/lib/PPIx/Regexp/Structure/Script_Run.pm libppix-regexp-perl-0.086/lib/PPIx/Regexp/Structure/Script_Run.pm --- libppix-regexp-perl-0.085/lib/PPIx/Regexp/Structure/Script_Run.pm 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/lib/PPIx/Regexp/Structure/Script_Run.pm 2022-12-13 14:26:59.000000000 +0000 @@ -9,7 +9,7 @@ use PPIx::Regexp::Constant qw{ @CARP_NOT }; -our $VERSION = '0.085'; +our $VERSION = '0.086'; 1; diff -Nru libppix-regexp-perl-0.085/lib/PPIx/Regexp/Structure/Subexpression.pm libppix-regexp-perl-0.086/lib/PPIx/Regexp/Structure/Subexpression.pm --- libppix-regexp-perl-0.085/lib/PPIx/Regexp/Structure/Subexpression.pm 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/lib/PPIx/Regexp/Structure/Subexpression.pm 2022-12-13 14:26:59.000000000 +0000 @@ -36,7 +36,7 @@ use PPIx::Regexp::Constant qw{ @CARP_NOT }; -our $VERSION = '0.085'; +our $VERSION = '0.086'; 1; diff -Nru libppix-regexp-perl-0.085/lib/PPIx/Regexp/Structure/Switch.pm libppix-regexp-perl-0.086/lib/PPIx/Regexp/Structure/Switch.pm --- libppix-regexp-perl-0.085/lib/PPIx/Regexp/Structure/Switch.pm 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/lib/PPIx/Regexp/Structure/Switch.pm 2022-12-13 14:26:59.000000000 +0000 @@ -36,7 +36,21 @@ use PPIx::Regexp::Constant qw{ @CARP_NOT }; -our $VERSION = '0.085'; +our $VERSION = '0.086'; + +sub __raw_width { + my ( $self ) = @_; + my $cond; + $cond = $self->schild( 0 ) + and $cond->isa( 'PPIx::Regexp::Token::Condition' ) + and $cond->content() eq '(DEFINE)' + and return ( 0, 0, 1 ); + my ( $node_min, $node_max, $alternatives ) = $self->SUPER::__raw_width(); + defined $node_min + and $alternatives < 2 + and $node_min = 0; + return ( $node_min, $node_max, $alternatives ); +} sub __PPIX_LEXER__finalize { my ( $self, $lexer ) = @_; diff -Nru libppix-regexp-perl-0.085/lib/PPIx/Regexp/Structure/Unknown.pm libppix-regexp-perl-0.086/lib/PPIx/Regexp/Structure/Unknown.pm --- libppix-regexp-perl-0.085/lib/PPIx/Regexp/Structure/Unknown.pm 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/lib/PPIx/Regexp/Structure/Unknown.pm 2022-12-13 14:26:59.000000000 +0000 @@ -37,7 +37,7 @@ use PPIx::Regexp::Constant qw{ @CARP_NOT }; use PPIx::Regexp::Util; -our $VERSION = '0.085'; +our $VERSION = '0.086'; sub __new { my ( $class, $content, %arg ) = @_; @@ -53,6 +53,10 @@ return $self; } +sub width { + return ( undef, undef ); +} + sub explain { my ( $self ) = @_; return $self->{explanation} || $self->SUPER::explain(); diff -Nru libppix-regexp-perl-0.085/lib/PPIx/Regexp/Structure.pm libppix-regexp-perl-0.086/lib/PPIx/Regexp/Structure.pm --- libppix-regexp-perl-0.085/lib/PPIx/Regexp/Structure.pm 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/lib/PPIx/Regexp/Structure.pm 2022-12-13 14:26:59.000000000 +0000 @@ -58,7 +58,7 @@ use PPIx::Regexp::Util qw{ __instance }; use Scalar::Util qw{ refaddr }; -our $VERSION = '0.085'; +our $VERSION = '0.086'; use constant ELEMENT_UNKNOWN => STRUCTURE_UNKNOWN; diff -Nru libppix-regexp-perl-0.085/lib/PPIx/Regexp/Support.pm libppix-regexp-perl-0.086/lib/PPIx/Regexp/Support.pm --- libppix-regexp-perl-0.085/lib/PPIx/Regexp/Support.pm 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/lib/PPIx/Regexp/Support.pm 2022-12-13 14:26:59.000000000 +0000 @@ -38,7 +38,7 @@ use PPIx::Regexp::Constant qw{ @CARP_NOT }; use PPIx::Regexp::Util qw{ __instance }; -our $VERSION = '0.085'; +our $VERSION = '0.086'; =head2 close_bracket diff -Nru libppix-regexp-perl-0.085/lib/PPIx/Regexp/Token/Assertion.pm libppix-regexp-perl-0.086/lib/PPIx/Regexp/Token/Assertion.pm --- libppix-regexp-perl-0.085/lib/PPIx/Regexp/Token/Assertion.pm 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/lib/PPIx/Regexp/Token/Assertion.pm 2022-12-13 14:26:59.000000000 +0000 @@ -58,7 +58,7 @@ use constant KEEP_EXPLANATION => 'In s///, keep everything before the \\K'; -our $VERSION = '0.085'; +our $VERSION = '0.086'; # Return true if the token can be quantified, and false otherwise # sub can_be_quantified { return }; diff -Nru libppix-regexp-perl-0.085/lib/PPIx/Regexp/Token/Backreference.pm libppix-regexp-perl-0.086/lib/PPIx/Regexp/Token/Backreference.pm --- libppix-regexp-perl-0.085/lib/PPIx/Regexp/Token/Backreference.pm 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/lib/PPIx/Regexp/Token/Backreference.pm 2022-12-13 14:26:59.000000000 +0000 @@ -42,9 +42,9 @@ TOKEN_UNKNOWN @CARP_NOT }; -use PPIx::Regexp::Util qw{ __to_ordinal_en }; +use PPIx::Regexp::Util qw{ __to_ordinal_en width }; -our $VERSION = '0.085'; +our $VERSION = '0.086'; # Return true if the token can be quantified, and false otherwise # sub can_be_quantified { return }; @@ -79,6 +79,49 @@ } +sub raw_width { + my ( $self ) = @_; + my $re = $self->top() + or return ( undef, undef ); # Shouldn't happen. + my @capture; + if ( $self->is_named() ) { + my $name = $self->name(); + foreach my $elem ( @{ $re->find( + 'PPIx::Regexp::Structure::NamedCapture' ) || [] } ) { + $elem->name() eq $name + or next; + $re->__token_post_order( $elem, $self ) < 0 + or last; + push @capture, $elem; + } + } else { + my $number = $self->absolute(); + foreach my $elem ( @{ $re->find( + 'PPIx::Regexp::Structure::Capture' ) || [] } ) { + $elem->number() == $number + or next; + $re->__token_post_order( $elem, $self ) < 0 + or last; + push @capture, $elem; + } + } + @capture == 1 + and return $capture[0]->raw_width(); + my ( $base_min, $base_max ) = $capture[0]->raw_width(); + foreach my $elem ( @capture[ 1 .. $#capture ] ) { + my ( $ele_min, $ele_max ) = $elem->raw_width(); + defined $ele_min + or $base_min = undef; + defined $base_min + and $base_min = $base_min == $ele_min ? $base_min : undef; + defined $ele_max + or $base_max = undef; + defined $base_max + and $base_max = $base_max == $ele_max ? $base_max : undef; + } + return ( $base_min, $base_max ); +} + my @external = ( # Recognition used externally [ qr{ \A \( \? P = ( @{[ RE_CAPTURE_NAME ]} ) \) }smxo, { is_named => 1 }, diff -Nru libppix-regexp-perl-0.085/lib/PPIx/Regexp/Token/Backtrack.pm libppix-regexp-perl-0.086/lib/PPIx/Regexp/Token/Backtrack.pm --- libppix-regexp-perl-0.085/lib/PPIx/Regexp/Token/Backtrack.pm 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/lib/PPIx/Regexp/Token/Backtrack.pm 2022-12-13 14:26:59.000000000 +0000 @@ -35,7 +35,7 @@ use PPIx::Regexp::Constant qw{ @CARP_NOT }; -our $VERSION = '0.085'; +our $VERSION = '0.086'; # Return true if the token can be quantified, and false otherwise sub can_be_quantified { return }; diff -Nru libppix-regexp-perl-0.085/lib/PPIx/Regexp/Token/CharClass/POSIX/Unknown.pm libppix-regexp-perl-0.086/lib/PPIx/Regexp/Token/CharClass/POSIX/Unknown.pm --- libppix-regexp-perl-0.085/lib/PPIx/Regexp/Token/CharClass/POSIX/Unknown.pm 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/lib/PPIx/Regexp/Token/CharClass/POSIX/Unknown.pm 2022-12-13 14:26:59.000000000 +0000 @@ -9,7 +9,7 @@ use PPIx::Regexp::Constant qw{ MINIMUM_PERL @CARP_NOT }; -our $VERSION = '0.085'; +our $VERSION = '0.086'; sub perl_version_introduced { # my ( $self ) = @_; diff -Nru libppix-regexp-perl-0.085/lib/PPIx/Regexp/Token/CharClass/POSIX.pm libppix-regexp-perl-0.086/lib/PPIx/Regexp/Token/CharClass/POSIX.pm --- libppix-regexp-perl-0.085/lib/PPIx/Regexp/Token/CharClass/POSIX.pm 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/lib/PPIx/Regexp/Token/CharClass/POSIX.pm 2022-12-13 14:26:59.000000000 +0000 @@ -48,7 +48,7 @@ @CARP_NOT }; -our $VERSION = '0.085'; +our $VERSION = '0.086'; # Return true if the token can be quantified, and false otherwise # sub can_be_quantified { return }; diff -Nru libppix-regexp-perl-0.085/lib/PPIx/Regexp/Token/CharClass/Simple.pm libppix-regexp-perl-0.086/lib/PPIx/Regexp/Token/CharClass/Simple.pm --- libppix-regexp-perl-0.085/lib/PPIx/Regexp/Token/CharClass/Simple.pm 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/lib/PPIx/Regexp/Token/CharClass/Simple.pm 2022-12-13 14:26:59.000000000 +0000 @@ -46,7 +46,7 @@ @CARP_NOT }; -our $VERSION = '0.085'; +our $VERSION = '0.086'; use constant UNICODE_PROPERTY_LITERAL_VALUE => qr/ \{ \s* \^? \w [\w:=\s-]* \} | diff -Nru libppix-regexp-perl-0.085/lib/PPIx/Regexp/Token/CharClass.pm libppix-regexp-perl-0.086/lib/PPIx/Regexp/Token/CharClass.pm --- libppix-regexp-perl-0.085/lib/PPIx/Regexp/Token/CharClass.pm 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/lib/PPIx/Regexp/Token/CharClass.pm 2022-12-13 14:26:59.000000000 +0000 @@ -41,7 +41,9 @@ use PPIx::Regexp::Constant qw{ @CARP_NOT }; -our $VERSION = '0.085'; +use PPIx::Regexp::Util qw{ :width_one }; + +our $VERSION = '0.086'; # Return true if the token can be quantified, and false otherwise # sub can_be_quantified { return }; diff -Nru libppix-regexp-perl-0.085/lib/PPIx/Regexp/Token/Code.pm libppix-regexp-perl-0.086/lib/PPIx/Regexp/Token/Code.pm --- libppix-regexp-perl-0.085/lib/PPIx/Regexp/Token/Code.pm 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/lib/PPIx/Regexp/Token/Code.pm 2022-12-13 14:26:59.000000000 +0000 @@ -56,7 +56,7 @@ }; use PPIx::Regexp::Util qw{ __instance }; -our $VERSION = '0.085'; +our $VERSION = '0.086'; use constant TOKENIZER_ARGUMENT_REQUIRED => 1; use constant VERSION_WHEN_IN_REGEX_SET => undef; @@ -175,6 +175,10 @@ } } +sub width { + return ( undef, undef ); +} + sub __ppi_normalize_content { my ( $self ) = @_; return $self->{content}; diff -Nru libppix-regexp-perl-0.085/lib/PPIx/Regexp/Token/Comment.pm libppix-regexp-perl-0.086/lib/PPIx/Regexp/Token/Comment.pm --- libppix-regexp-perl-0.085/lib/PPIx/Regexp/Token/Comment.pm 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/lib/PPIx/Regexp/Token/Comment.pm 2022-12-13 14:26:59.000000000 +0000 @@ -36,7 +36,7 @@ use PPIx::Regexp::Constant qw{ @CARP_NOT }; -our $VERSION = '0.085'; +our $VERSION = '0.086'; # Return true if the token can be quantified, and false otherwise sub can_be_quantified { return }; diff -Nru libppix-regexp-perl-0.085/lib/PPIx/Regexp/Token/Condition.pm libppix-regexp-perl-0.086/lib/PPIx/Regexp/Token/Condition.pm --- libppix-regexp-perl-0.085/lib/PPIx/Regexp/Token/Condition.pm 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/lib/PPIx/Regexp/Token/Condition.pm 2022-12-13 14:26:59.000000000 +0000 @@ -37,7 +37,7 @@ use PPIx::Regexp::Constant qw{ RE_CAPTURE_NAME @CARP_NOT }; -our $VERSION = '0.085'; +our $VERSION = '0.086'; { diff -Nru libppix-regexp-perl-0.085/lib/PPIx/Regexp/Token/Control.pm libppix-regexp-perl-0.086/lib/PPIx/Regexp/Token/Control.pm --- libppix-regexp-perl-0.085/lib/PPIx/Regexp/Token/Control.pm 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/lib/PPIx/Regexp/Token/Control.pm 2022-12-13 14:26:59.000000000 +0000 @@ -49,7 +49,7 @@ @CARP_NOT }; -our $VERSION = '0.085'; +our $VERSION = '0.086'; # Return true if the token can be quantified, and false otherwise # sub can_be_quantified { return }; diff -Nru libppix-regexp-perl-0.085/lib/PPIx/Regexp/Token/Delimiter.pm libppix-regexp-perl-0.086/lib/PPIx/Regexp/Token/Delimiter.pm --- libppix-regexp-perl-0.085/lib/PPIx/Regexp/Token/Delimiter.pm 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/lib/PPIx/Regexp/Token/Delimiter.pm 2022-12-13 14:26:59.000000000 +0000 @@ -37,7 +37,7 @@ use PPIx::Regexp::Constant qw{ MINIMUM_PERL @CARP_NOT }; -our $VERSION = '0.085'; +our $VERSION = '0.086'; # Return true if the token can be quantified, and false otherwise # sub can_be_quantified { return }; diff -Nru libppix-regexp-perl-0.085/lib/PPIx/Regexp/Token/Greediness.pm libppix-regexp-perl-0.086/lib/PPIx/Regexp/Token/Greediness.pm --- libppix-regexp-perl-0.085/lib/PPIx/Regexp/Token/Greediness.pm 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/lib/PPIx/Regexp/Token/Greediness.pm 2022-12-13 14:26:59.000000000 +0000 @@ -37,7 +37,7 @@ use PPIx::Regexp::Constant qw{ MINIMUM_PERL @CARP_NOT }; -our $VERSION = '0.085'; +our $VERSION = '0.086'; # Return true if the token can be quantified, and false otherwise sub can_be_quantified { return }; diff -Nru libppix-regexp-perl-0.085/lib/PPIx/Regexp/Token/GroupType/Assertion.pm libppix-regexp-perl-0.086/lib/PPIx/Regexp/Token/GroupType/Assertion.pm --- libppix-regexp-perl-0.085/lib/PPIx/Regexp/Token/GroupType/Assertion.pm 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/lib/PPIx/Regexp/Token/GroupType/Assertion.pm 2022-12-13 14:26:59.000000000 +0000 @@ -39,7 +39,7 @@ @CARP_NOT }; -our $VERSION = '0.085'; +our $VERSION = '0.086'; use constant EXPL_NLA => 'Negative look-ahead assertion'; use constant EXPL_NLB => 'Negative look-behind assertion'; diff -Nru libppix-regexp-perl-0.085/lib/PPIx/Regexp/Token/GroupType/Atomic_Script_Run.pm libppix-regexp-perl-0.086/lib/PPIx/Regexp/Token/GroupType/Atomic_Script_Run.pm --- libppix-regexp-perl-0.085/lib/PPIx/Regexp/Token/GroupType/Atomic_Script_Run.pm 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/lib/PPIx/Regexp/Token/GroupType/Atomic_Script_Run.pm 2022-12-13 14:26:59.000000000 +0000 @@ -9,7 +9,7 @@ use PPIx::Regexp::Constant qw{ @CARP_NOT }; -our $VERSION = '0.085'; +our $VERSION = '0.086'; use constant EXPL => 'All characters must be in same script, atomic version'; diff -Nru libppix-regexp-perl-0.085/lib/PPIx/Regexp/Token/GroupType/BranchReset.pm libppix-regexp-perl-0.086/lib/PPIx/Regexp/Token/GroupType/BranchReset.pm --- libppix-regexp-perl-0.085/lib/PPIx/Regexp/Token/GroupType/BranchReset.pm 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/lib/PPIx/Regexp/Token/GroupType/BranchReset.pm 2022-12-13 14:26:59.000000000 +0000 @@ -36,7 +36,7 @@ use PPIx::Regexp::Constant qw{ @CARP_NOT }; -our $VERSION = '0.085'; +our $VERSION = '0.086'; =begin comment diff -Nru libppix-regexp-perl-0.085/lib/PPIx/Regexp/Token/GroupType/Code.pm libppix-regexp-perl-0.086/lib/PPIx/Regexp/Token/GroupType/Code.pm --- libppix-regexp-perl-0.085/lib/PPIx/Regexp/Token/GroupType/Code.pm 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/lib/PPIx/Regexp/Token/GroupType/Code.pm 2022-12-13 14:26:59.000000000 +0000 @@ -43,7 +43,7 @@ use PPIx::Regexp::Constant qw{ @CARP_NOT }; -our $VERSION = '0.085'; +our $VERSION = '0.086'; sub __match_setup { my ( undef, $tokenizer ) = @_; # Invocant unused diff -Nru libppix-regexp-perl-0.085/lib/PPIx/Regexp/Token/GroupType/Modifier.pm libppix-regexp-perl-0.086/lib/PPIx/Regexp/Token/GroupType/Modifier.pm --- libppix-regexp-perl-0.085/lib/PPIx/Regexp/Token/GroupType/Modifier.pm 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/lib/PPIx/Regexp/Token/GroupType/Modifier.pm 2022-12-13 14:26:59.000000000 +0000 @@ -38,7 +38,7 @@ use PPIx::Regexp::Constant qw{ MINIMUM_PERL @CARP_NOT }; -our $VERSION = '0.085'; +our $VERSION = '0.086'; { diff -Nru libppix-regexp-perl-0.085/lib/PPIx/Regexp/Token/GroupType/NamedCapture.pm libppix-regexp-perl-0.086/lib/PPIx/Regexp/Token/GroupType/NamedCapture.pm --- libppix-regexp-perl-0.085/lib/PPIx/Regexp/Token/GroupType/NamedCapture.pm 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/lib/PPIx/Regexp/Token/GroupType/NamedCapture.pm 2022-12-13 14:26:59.000000000 +0000 @@ -43,7 +43,7 @@ use PPIx::Regexp::Constant qw{ RE_CAPTURE_NAME @CARP_NOT }; -our $VERSION = '0.085'; +our $VERSION = '0.086'; use constant TOKENIZER_ARGUMENT_REQUIRED => 1; diff -Nru libppix-regexp-perl-0.085/lib/PPIx/Regexp/Token/GroupType/Script_Run.pm libppix-regexp-perl-0.086/lib/PPIx/Regexp/Token/GroupType/Script_Run.pm --- libppix-regexp-perl-0.085/lib/PPIx/Regexp/Token/GroupType/Script_Run.pm 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/lib/PPIx/Regexp/Token/GroupType/Script_Run.pm 2022-12-13 14:26:59.000000000 +0000 @@ -9,7 +9,7 @@ use PPIx::Regexp::Constant qw{ @CARP_NOT }; -our $VERSION = '0.085'; +our $VERSION = '0.086'; use constant EXPL => 'All characters must be in same script'; diff -Nru libppix-regexp-perl-0.085/lib/PPIx/Regexp/Token/GroupType/Subexpression.pm libppix-regexp-perl-0.086/lib/PPIx/Regexp/Token/GroupType/Subexpression.pm --- libppix-regexp-perl-0.085/lib/PPIx/Regexp/Token/GroupType/Subexpression.pm 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/lib/PPIx/Regexp/Token/GroupType/Subexpression.pm 2022-12-13 14:26:59.000000000 +0000 @@ -36,7 +36,7 @@ use PPIx::Regexp::Constant qw{ @CARP_NOT }; -our $VERSION = '0.085'; +our $VERSION = '0.086'; use constant EXPL => 'Match subexpression without backtracking'; diff -Nru libppix-regexp-perl-0.085/lib/PPIx/Regexp/Token/GroupType/Switch.pm libppix-regexp-perl-0.086/lib/PPIx/Regexp/Token/GroupType/Switch.pm --- libppix-regexp-perl-0.085/lib/PPIx/Regexp/Token/GroupType/Switch.pm 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/lib/PPIx/Regexp/Token/GroupType/Switch.pm 2022-12-13 14:26:59.000000000 +0000 @@ -37,7 +37,7 @@ use PPIx::Regexp::Constant qw{ @CARP_NOT }; -our $VERSION = '0.085'; +our $VERSION = '0.086'; sub __match_setup { my ( undef, $tokenizer ) = @_; # Invocant unused diff -Nru libppix-regexp-perl-0.085/lib/PPIx/Regexp/Token/GroupType.pm libppix-regexp-perl-0.086/lib/PPIx/Regexp/Token/GroupType.pm --- libppix-regexp-perl-0.085/lib/PPIx/Regexp/Token/GroupType.pm 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/lib/PPIx/Regexp/Token/GroupType.pm 2022-12-13 14:26:59.000000000 +0000 @@ -48,7 +48,7 @@ use PPIx::Regexp::Constant qw{ MINIMUM_PERL @CARP_NOT }; use PPIx::Regexp::Util qw{ __ns_can }; -our $VERSION = '0.085'; +our $VERSION = '0.086'; # Return true if the token can be quantified, and false otherwise sub can_be_quantified { return }; diff -Nru libppix-regexp-perl-0.085/lib/PPIx/Regexp/Token/Interpolation.pm libppix-regexp-perl-0.086/lib/PPIx/Regexp/Token/Interpolation.pm --- libppix-regexp-perl-0.085/lib/PPIx/Regexp/Token/Interpolation.pm 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/lib/PPIx/Regexp/Token/Interpolation.pm 2022-12-13 14:26:59.000000000 +0000 @@ -53,7 +53,7 @@ @CARP_NOT }; -our $VERSION = '0.085'; +our $VERSION = '0.086'; use constant VERSION_WHEN_IN_REGEX_SET => '5.017009'; diff -Nru libppix-regexp-perl-0.085/lib/PPIx/Regexp/Token/Literal.pm libppix-regexp-perl-0.086/lib/PPIx/Regexp/Token/Literal.pm --- libppix-regexp-perl-0.085/lib/PPIx/Regexp/Token/Literal.pm 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/lib/PPIx/Regexp/Token/Literal.pm 2022-12-13 14:26:59.000000000 +0000 @@ -45,7 +45,9 @@ @CARP_NOT }; -our $VERSION = '0.085'; +use PPIx::Regexp::Util qw{ :width_one }; + +our $VERSION = '0.086'; sub __new { my ( $class, $content, %arg ) = @_; diff -Nru libppix-regexp-perl-0.085/lib/PPIx/Regexp/Token/Modifier.pm libppix-regexp-perl-0.086/lib/PPIx/Regexp/Token/Modifier.pm --- libppix-regexp-perl-0.085/lib/PPIx/Regexp/Token/Modifier.pm 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/lib/PPIx/Regexp/Token/Modifier.pm 2022-12-13 14:26:59.000000000 +0000 @@ -105,7 +105,7 @@ @CARP_NOT }; -our $VERSION = '0.085'; +our $VERSION = '0.086'; # Define modifiers that are to be aggregated internally for ease of # computation. diff -Nru libppix-regexp-perl-0.085/lib/PPIx/Regexp/Token/NoOp.pm libppix-regexp-perl-0.086/lib/PPIx/Regexp/Token/NoOp.pm --- libppix-regexp-perl-0.085/lib/PPIx/Regexp/Token/NoOp.pm 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/lib/PPIx/Regexp/Token/NoOp.pm 2022-12-13 14:26:59.000000000 +0000 @@ -10,7 +10,7 @@ use Carp; use PPIx::Regexp::Constant qw{ MINIMUM_PERL @CARP_NOT }; -our $VERSION = '0.085'; +our $VERSION = '0.086'; { my %when_removed = ( diff -Nru libppix-regexp-perl-0.085/lib/PPIx/Regexp/Token/Operator.pm libppix-regexp-perl-0.086/lib/PPIx/Regexp/Token/Operator.pm --- libppix-regexp-perl-0.085/lib/PPIx/Regexp/Token/Operator.pm 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/lib/PPIx/Regexp/Token/Operator.pm 2022-12-13 14:26:59.000000000 +0000 @@ -43,7 +43,7 @@ }; use PPIx::Regexp::Util qw{ __instance }; -our $VERSION = '0.085'; +our $VERSION = '0.086'; use constant TOKENIZER_ARGUMENT_REQUIRED => 1; diff -Nru libppix-regexp-perl-0.085/lib/PPIx/Regexp/Token/Quantifier.pm libppix-regexp-perl-0.086/lib/PPIx/Regexp/Token/Quantifier.pm --- libppix-regexp-perl-0.085/lib/PPIx/Regexp/Token/Quantifier.pm 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/lib/PPIx/Regexp/Token/Quantifier.pm 2022-12-13 14:26:59.000000000 +0000 @@ -39,7 +39,9 @@ use base qw{ PPIx::Regexp::Token }; +use Carp; use PPIx::Regexp::Constant qw{ + INFINITY LITERAL_LEFT_CURLY_ALLOWED MSG_LOOK_BEHIND_TOO_LONG TOKEN_UNKNOWN @@ -47,7 +49,7 @@ @CARP_NOT }; -our $VERSION = '0.085'; +our $VERSION = '0.086'; # Return true if the token can be quantified, and false otherwise sub can_be_quantified { return }; @@ -111,6 +113,27 @@ } } +{ + my %width = ( + '*' => [ 0, INFINITY ], + '+' => [ 1, INFINITY ], + '?' => [ 0, 1 ], + ); + + sub __quantified_width { + my ( $self, $raw_min, $raw_max ) = @_; + my $info = $width{$self->content()} + or croak sprintf q, + $self->content(); + my ( $my_min, $my_max ) = @{ $info }; + defined $raw_min + and $raw_min *= $my_min; + defined $raw_max + and $raw_max *= $my_max; + return ( $raw_min, $raw_max ); + } +} + sub __PPIX_TOKENIZER__regexp { my ( undef, $tokenizer, $character ) = @_; diff -Nru libppix-regexp-perl-0.085/lib/PPIx/Regexp/Token/Recursion.pm libppix-regexp-perl-0.086/lib/PPIx/Regexp/Token/Recursion.pm --- libppix-regexp-perl-0.085/lib/PPIx/Regexp/Token/Recursion.pm 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/lib/PPIx/Regexp/Token/Recursion.pm 2022-12-13 14:26:59.000000000 +0000 @@ -36,7 +36,7 @@ use Carp qw{ confess }; use PPIx::Regexp::Constant qw{ RE_CAPTURE_NAME @CARP_NOT }; -our $VERSION = '0.085'; +our $VERSION = '0.086'; # Return true if the token can be quantified, and false otherwise # sub can_be_quantified { return }; @@ -68,6 +68,14 @@ return '5.009005'; } +sub raw_width { + return ( undef, undef ); +} + +sub width { + return ( undef, undef ); +} + # This must be implemented by tokens which do not recognize themselves. # The return is a list of list references. Each list reference must # contain a regular expression that recognizes the token, and optionally diff -Nru libppix-regexp-perl-0.085/lib/PPIx/Regexp/Token/Reference.pm libppix-regexp-perl-0.086/lib/PPIx/Regexp/Token/Reference.pm --- libppix-regexp-perl-0.085/lib/PPIx/Regexp/Token/Reference.pm 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/lib/PPIx/Regexp/Token/Reference.pm 2022-12-13 14:26:59.000000000 +0000 @@ -43,7 +43,7 @@ use List::Util qw{ first }; use PPIx::Regexp::Constant qw{ @CARP_NOT }; -our $VERSION = '0.085'; +our $VERSION = '0.086'; sub __new { my ( $class, $content, %arg ) = @_; diff -Nru libppix-regexp-perl-0.085/lib/PPIx/Regexp/Token/Structure.pm libppix-regexp-perl-0.086/lib/PPIx/Regexp/Token/Structure.pm --- libppix-regexp-perl-0.085/lib/PPIx/Regexp/Token/Structure.pm 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/lib/PPIx/Regexp/Token/Structure.pm 2022-12-13 14:26:59.000000000 +0000 @@ -54,7 +54,7 @@ use PPIx::Regexp::Token::Backtrack (); use PPIx::Regexp::Token::Recursion (); -our $VERSION = '0.085'; +our $VERSION = '0.086'; # Return true if the token can be quantified, and false otherwise diff -Nru libppix-regexp-perl-0.085/lib/PPIx/Regexp/Token/Unknown.pm libppix-regexp-perl-0.086/lib/PPIx/Regexp/Token/Unknown.pm --- libppix-regexp-perl-0.085/lib/PPIx/Regexp/Token/Unknown.pm 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/lib/PPIx/Regexp/Token/Unknown.pm 2022-12-13 14:26:59.000000000 +0000 @@ -41,7 +41,7 @@ use PPIx::Regexp::Constant qw{ @CARP_NOT }; use PPIx::Regexp::Util; -our $VERSION = '0.085'; +our $VERSION = '0.086'; sub __new { my ( $class, $content, %arg ) = @_; @@ -92,6 +92,10 @@ return ord $self->content(); } +sub width { + return ( undef, undef ); +} + *__PPIX_ELEM__post_reblessing = \&PPIx::Regexp::Util::__post_rebless_error; # Since the lexer does not count these on the way in (because it needs diff -Nru libppix-regexp-perl-0.085/lib/PPIx/Regexp/Token/Unmatched.pm libppix-regexp-perl-0.086/lib/PPIx/Regexp/Token/Unmatched.pm --- libppix-regexp-perl-0.085/lib/PPIx/Regexp/Token/Unmatched.pm 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/lib/PPIx/Regexp/Token/Unmatched.pm 2022-12-13 14:26:59.000000000 +0000 @@ -41,7 +41,7 @@ use PPIx::Regexp::Constant qw{ @CARP_NOT }; -our $VERSION = '0.085'; +our $VERSION = '0.086'; # Return true if the token can be quantified, and false otherwise # sub can_be_quantified { return }; diff -Nru libppix-regexp-perl-0.085/lib/PPIx/Regexp/Token/Whitespace.pm libppix-regexp-perl-0.086/lib/PPIx/Regexp/Token/Whitespace.pm --- libppix-regexp-perl-0.085/lib/PPIx/Regexp/Token/Whitespace.pm 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/lib/PPIx/Regexp/Token/Whitespace.pm 2022-12-13 14:26:59.000000000 +0000 @@ -46,7 +46,7 @@ @CARP_NOT }; -our $VERSION = '0.085'; +our $VERSION = '0.086'; sub __new { my ( $class, $content, %arg ) = @_; diff -Nru libppix-regexp-perl-0.085/lib/PPIx/Regexp/Tokenizer.pm libppix-regexp-perl-0.086/lib/PPIx/Regexp/Tokenizer.pm --- libppix-regexp-perl-0.085/lib/PPIx/Regexp/Tokenizer.pm 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/lib/PPIx/Regexp/Tokenizer.pm 2022-12-13 14:26:59.000000000 +0000 @@ -57,7 +57,7 @@ use Scalar::Util qw{ looks_like_number }; -our $VERSION = '0.085'; +our $VERSION = '0.086'; our $DEFAULT_POSTDEREF; defined $DEFAULT_POSTDEREF diff -Nru libppix-regexp-perl-0.085/lib/PPIx/Regexp/Token.pm libppix-regexp-perl-0.086/lib/PPIx/Regexp/Token.pm --- libppix-regexp-perl-0.085/lib/PPIx/Regexp/Token.pm 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/lib/PPIx/Regexp/Token.pm 2022-12-13 14:26:59.000000000 +0000 @@ -53,7 +53,7 @@ use Carp qw{ confess }; use PPIx::Regexp::Constant qw{ MINIMUM_PERL @CARP_NOT }; -our $VERSION = '0.085'; +our $VERSION = '0.086'; use constant TOKENIZER_ARGUMENT_REQUIRED => 0; diff -Nru libppix-regexp-perl-0.085/lib/PPIx/Regexp/Util.pm libppix-regexp-perl-0.086/lib/PPIx/Regexp/Util.pm --- libppix-regexp-perl-0.085/lib/PPIx/Regexp/Util.pm 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/lib/PPIx/Regexp/Util.pm 2022-12-13 14:26:59.000000000 +0000 @@ -7,6 +7,8 @@ use Carp; use PPIx::Regexp::Constant qw{ + INFINITY + MINIMUM_PERL @CARP_NOT }; use Scalar::Util qw{ blessed }; @@ -18,12 +20,20 @@ __choose_tokenizer_class __instance __is_ppi_regexp_element + __merge_perl_requirements __ns_can __post_rebless_error + raw_width __to_ordinal_en + width }; -our $VERSION = '0.085'; +our %EXPORT_TAGS = ( + all => \@EXPORT_OK, + width_one => [ qw{ raw_width width } ], +); + +our $VERSION = '0.086'; sub is_ppi_regexp_element { my ( $elem ) = @_; @@ -60,6 +70,35 @@ return $object->isa( $class ); } +sub __merge_perl_requirements { ## no critic (RequireArgUnpacking) + my @work = + sort { $a->[0] <=> $b->[0] || $b->[1] <=> $a->[1] } + map { ( [ $_->[0], 1 ], [ $_->[1], 0 ] ) } + map { [ $_->{introduced}, defined $_->{removed} ? $_->{removed} : INFINITY ] } @_; + my @rslt; + while ( @work ) { + my ( $intro, $rem ); + $intro = ( shift @work )->[0] while @work && $work[0][1]; + if ( @work ) { + $rem = $work[0][0]; + shift @work while @work && ! $work[0][1]; + } + defined $intro + or $intro = MINIMUM_PERL; + defined $rem + or $rem = INFINITY; + $intro != $rem + and push @rslt, { + introduced => $intro, + removed => $rem, + }; + } + @rslt + and $rslt[-1]{removed} == INFINITY + and delete $rslt[-1]{removed}; + return @rslt; +} + sub __ns_can { my ( $class, $name ) = @_; my $fqn = join '::', ref $class || $class, $name; @@ -83,6 +122,11 @@ } +# Unquantified number of characters matched. +sub raw_width { + return ( 1, 1 ); +} + sub __to_ordinal_en { my ( $num ) = @_; $num += 0; @@ -97,6 +141,16 @@ return "${num}th"; } +sub width { + my ( $self ) = @_; + my @raw_width = $self->raw_width(); + my ( $code, $next_sib ); + $next_sib = $self->snext_sibling() + and $code = $next_sib->can( '__quantified_width' ) + or return @raw_width; + return $code->( $next_sib, @raw_width ); +} + 1; __END__ @@ -162,6 +216,13 @@ and is deprecated in favor of it. If called, it will complain via C and then C. +=head2 __merge_perl_requirements + +This subroutine is B to the C package. + +This subroutine merges perl requirements as returned by the various +C<__perl_requirements()> methods. + =head2 __ns_can This subroutine is B to the C package. @@ -180,6 +241,15 @@ It returns the number of errors to add to the parse. +=head2 raw_width + +This public method returns the minimum and maximum width matched by the +element before taking into account such details as what the element +actually is and how it is quantified. + +This implementation is appropriate to things that match exactly one +character -- i.e. it returns C<( 1, 1 )>. + =head2 __to_ordinal_en This subroutine is B to the C package. @@ -190,6 +260,30 @@ say __to_ordinal_en( 17 ); # 17th +=head2 width + + my ( $min_wid, $max_wid ) = $self->width(); + +This public method (well, mixin) returns the minimum and maximum width +of the text matched by the element. + +Elements which import this method must also implement a C +method which returns the unquantified width of the element. + +=head1 EXPORT TAGS + +The following export tags are defined by this module. All are private to +the C package unless otherwise documented. + +=head2 all + +This tag exports everything exportable by this module. + +=head2 width_one + +This tag is appropriate to an element which, when unquantified, matches +exactly one character. It exports C and C. + =head1 SEE ALSO L, which I recommend, but in the case of diff -Nru libppix-regexp-perl-0.085/lib/PPIx/Regexp.pm libppix-regexp-perl-0.086/lib/PPIx/Regexp.pm --- libppix-regexp-perl-0.085/lib/PPIx/Regexp.pm 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/lib/PPIx/Regexp.pm 2022-12-13 14:26:59.000000000 +0000 @@ -195,7 +195,7 @@ }; use Scalar::Util qw{ refaddr }; -our $VERSION = '0.085'; +our $VERSION = '0.086'; =head2 new @@ -933,6 +933,10 @@ perl 5.10 and later are not supported. I have no idea how I missed this when I originally went looking for C parsers. +L, which recognizes Perl of all sorts, including regular +expressions, but does not actually provide a parse of the recognized +constructs. + =head1 SUPPORT Support is by the author. Please file bug reports at diff -Nru libppix-regexp-perl-0.085/MANIFEST libppix-regexp-perl-0.086/MANIFEST --- libppix-regexp-perl-0.085/MANIFEST 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/MANIFEST 2022-12-13 14:26:59.000000000 +0000 @@ -86,11 +86,13 @@ README t/basic.t t/fuzz.t +t/inf.t t/locations.t t/parse.t t/unit-adhoc.t t/unit.t t/version.t +t/width.t t/xplain.t xt/author/carp_not.t xt/author/changes.t diff -Nru libppix-regexp-perl-0.085/META.json libppix-regexp-perl-0.086/META.json --- libppix-regexp-perl-0.085/META.json 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/META.json 2022-12-13 14:26:59.000000000 +0000 @@ -4,7 +4,7 @@ "Thomas R. Wyant, III F" ], "dynamic_config" : 1, - "generated_by" : "Module::Build version 0.4231", + "generated_by" : "Module::Build version 0.4232", "license" : [ "perl_5" ], @@ -50,6 +50,7 @@ "Task::Weaken" : "0", "base" : "0", "constant" : "0", + "overload" : "0", "perl" : "5.006", "strict" : "0", "warnings" : "0" @@ -59,263 +60,267 @@ "provides" : { "PPIx::Regexp" : { "file" : "lib/PPIx/Regexp.pm", - "version" : "0.085" + "version" : "0.086" }, "PPIx::Regexp::Constant" : { "file" : "lib/PPIx/Regexp/Constant.pm", - "version" : "0.085" + "version" : "0.085_04" + }, + "PPIx::Regexp::Constant::Inf" : { + "file" : "lib/PPIx/Regexp/Constant.pm", + "version" : "0.086" }, "PPIx::Regexp::Dumper" : { "file" : "lib/PPIx/Regexp/Dumper.pm", - "version" : "0.085" + "version" : "0.086" }, "PPIx::Regexp::Element" : { "file" : "lib/PPIx/Regexp/Element.pm", - "version" : "0.085" + "version" : "0.086" }, "PPIx::Regexp::Lexer" : { "file" : "lib/PPIx/Regexp/Lexer.pm", - "version" : "0.085" + "version" : "0.086" }, "PPIx::Regexp::Node" : { "file" : "lib/PPIx/Regexp/Node.pm", - "version" : "0.085" + "version" : "0.086" }, "PPIx::Regexp::Node::Range" : { "file" : "lib/PPIx/Regexp/Node/Range.pm", - "version" : "0.085" + "version" : "0.086" }, "PPIx::Regexp::Node::Unknown" : { "file" : "lib/PPIx/Regexp/Node/Unknown.pm", - "version" : "0.085" + "version" : "0.086" }, "PPIx::Regexp::Structure" : { "file" : "lib/PPIx/Regexp/Structure.pm", - "version" : "0.085" + "version" : "0.086" }, "PPIx::Regexp::Structure::Assertion" : { "file" : "lib/PPIx/Regexp/Structure/Assertion.pm", - "version" : "0.085" + "version" : "0.086" }, "PPIx::Regexp::Structure::Atomic_Script_Run" : { "file" : "lib/PPIx/Regexp/Structure/Atomic_Script_Run.pm", - "version" : "0.085" + "version" : "0.086" }, "PPIx::Regexp::Structure::BranchReset" : { "file" : "lib/PPIx/Regexp/Structure/BranchReset.pm", - "version" : "0.085" + "version" : "0.086" }, "PPIx::Regexp::Structure::Capture" : { "file" : "lib/PPIx/Regexp/Structure/Capture.pm", - "version" : "0.085" + "version" : "0.086" }, "PPIx::Regexp::Structure::CharClass" : { "file" : "lib/PPIx/Regexp/Structure/CharClass.pm", - "version" : "0.085" + "version" : "0.086" }, "PPIx::Regexp::Structure::Code" : { "file" : "lib/PPIx/Regexp/Structure/Code.pm", - "version" : "0.085" + "version" : "0.086" }, "PPIx::Regexp::Structure::Main" : { "file" : "lib/PPIx/Regexp/Structure/Main.pm", - "version" : "0.085" + "version" : "0.086" }, "PPIx::Regexp::Structure::Modifier" : { "file" : "lib/PPIx/Regexp/Structure/Modifier.pm", - "version" : "0.085" + "version" : "0.086" }, "PPIx::Regexp::Structure::NamedCapture" : { "file" : "lib/PPIx/Regexp/Structure/NamedCapture.pm", - "version" : "0.085" + "version" : "0.086" }, "PPIx::Regexp::Structure::Quantifier" : { "file" : "lib/PPIx/Regexp/Structure/Quantifier.pm", - "version" : "0.085" + "version" : "0.086" }, "PPIx::Regexp::Structure::RegexSet" : { "file" : "lib/PPIx/Regexp/Structure/RegexSet.pm", - "version" : "0.085" + "version" : "0.086" }, "PPIx::Regexp::Structure::Regexp" : { "file" : "lib/PPIx/Regexp/Structure/Regexp.pm", - "version" : "0.085" + "version" : "0.086" }, "PPIx::Regexp::Structure::Replacement" : { "file" : "lib/PPIx/Regexp/Structure/Replacement.pm", - "version" : "0.085" + "version" : "0.086" }, "PPIx::Regexp::Structure::Script_Run" : { "file" : "lib/PPIx/Regexp/Structure/Script_Run.pm", - "version" : "0.085" + "version" : "0.086" }, "PPIx::Regexp::Structure::Subexpression" : { "file" : "lib/PPIx/Regexp/Structure/Subexpression.pm", - "version" : "0.085" + "version" : "0.086" }, "PPIx::Regexp::Structure::Switch" : { "file" : "lib/PPIx/Regexp/Structure/Switch.pm", - "version" : "0.085" + "version" : "0.086" }, "PPIx::Regexp::Structure::Unknown" : { "file" : "lib/PPIx/Regexp/Structure/Unknown.pm", - "version" : "0.085" + "version" : "0.086" }, "PPIx::Regexp::Support" : { "file" : "lib/PPIx/Regexp/Support.pm", - "version" : "0.085" + "version" : "0.086" }, "PPIx::Regexp::Token" : { "file" : "lib/PPIx/Regexp/Token.pm", - "version" : "0.085" + "version" : "0.086" }, "PPIx::Regexp::Token::Assertion" : { "file" : "lib/PPIx/Regexp/Token/Assertion.pm", - "version" : "0.085" + "version" : "0.086" }, "PPIx::Regexp::Token::Backreference" : { "file" : "lib/PPIx/Regexp/Token/Backreference.pm", - "version" : "0.085" + "version" : "0.086" }, "PPIx::Regexp::Token::Backtrack" : { "file" : "lib/PPIx/Regexp/Token/Backtrack.pm", - "version" : "0.085" + "version" : "0.086" }, "PPIx::Regexp::Token::CharClass" : { "file" : "lib/PPIx/Regexp/Token/CharClass.pm", - "version" : "0.085" + "version" : "0.086" }, "PPIx::Regexp::Token::CharClass::POSIX" : { "file" : "lib/PPIx/Regexp/Token/CharClass/POSIX.pm", - "version" : "0.085" + "version" : "0.086" }, "PPIx::Regexp::Token::CharClass::POSIX::Unknown" : { "file" : "lib/PPIx/Regexp/Token/CharClass/POSIX/Unknown.pm", - "version" : "0.085" + "version" : "0.086" }, "PPIx::Regexp::Token::CharClass::Simple" : { "file" : "lib/PPIx/Regexp/Token/CharClass/Simple.pm", - "version" : "0.085" + "version" : "0.086" }, "PPIx::Regexp::Token::Code" : { "file" : "lib/PPIx/Regexp/Token/Code.pm", - "version" : "0.085" + "version" : "0.086" }, "PPIx::Regexp::Token::Comment" : { "file" : "lib/PPIx/Regexp/Token/Comment.pm", - "version" : "0.085" + "version" : "0.086" }, "PPIx::Regexp::Token::Condition" : { "file" : "lib/PPIx/Regexp/Token/Condition.pm", - "version" : "0.085" + "version" : "0.086" }, "PPIx::Regexp::Token::Control" : { "file" : "lib/PPIx/Regexp/Token/Control.pm", - "version" : "0.085" + "version" : "0.086" }, "PPIx::Regexp::Token::Delimiter" : { "file" : "lib/PPIx/Regexp/Token/Delimiter.pm", - "version" : "0.085" + "version" : "0.086" }, "PPIx::Regexp::Token::Greediness" : { "file" : "lib/PPIx/Regexp/Token/Greediness.pm", - "version" : "0.085" + "version" : "0.086" }, "PPIx::Regexp::Token::GroupType" : { "file" : "lib/PPIx/Regexp/Token/GroupType.pm", - "version" : "0.085" + "version" : "0.086" }, "PPIx::Regexp::Token::GroupType::Assertion" : { "file" : "lib/PPIx/Regexp/Token/GroupType/Assertion.pm", - "version" : "0.085" + "version" : "0.086" }, "PPIx::Regexp::Token::GroupType::Atomic_Script_Run" : { "file" : "lib/PPIx/Regexp/Token/GroupType/Atomic_Script_Run.pm", - "version" : "0.085" + "version" : "0.086" }, "PPIx::Regexp::Token::GroupType::BranchReset" : { "file" : "lib/PPIx/Regexp/Token/GroupType/BranchReset.pm", - "version" : "0.085" + "version" : "0.086" }, "PPIx::Regexp::Token::GroupType::Code" : { "file" : "lib/PPIx/Regexp/Token/GroupType/Code.pm", - "version" : "0.085" + "version" : "0.086" }, "PPIx::Regexp::Token::GroupType::Modifier" : { "file" : "lib/PPIx/Regexp/Token/GroupType/Modifier.pm", - "version" : "0.085" + "version" : "0.086" }, "PPIx::Regexp::Token::GroupType::NamedCapture" : { "file" : "lib/PPIx/Regexp/Token/GroupType/NamedCapture.pm", - "version" : "0.085" + "version" : "0.086" }, "PPIx::Regexp::Token::GroupType::Script_Run" : { "file" : "lib/PPIx/Regexp/Token/GroupType/Script_Run.pm", - "version" : "0.085" + "version" : "0.086" }, "PPIx::Regexp::Token::GroupType::Subexpression" : { "file" : "lib/PPIx/Regexp/Token/GroupType/Subexpression.pm", - "version" : "0.085" + "version" : "0.086" }, "PPIx::Regexp::Token::GroupType::Switch" : { "file" : "lib/PPIx/Regexp/Token/GroupType/Switch.pm", - "version" : "0.085" + "version" : "0.086" }, "PPIx::Regexp::Token::Interpolation" : { "file" : "lib/PPIx/Regexp/Token/Interpolation.pm", - "version" : "0.085" + "version" : "0.086" }, "PPIx::Regexp::Token::Literal" : { "file" : "lib/PPIx/Regexp/Token/Literal.pm", - "version" : "0.085" + "version" : "0.086" }, "PPIx::Regexp::Token::Modifier" : { "file" : "lib/PPIx/Regexp/Token/Modifier.pm", - "version" : "0.085" + "version" : "0.086" }, "PPIx::Regexp::Token::NoOp" : { "file" : "lib/PPIx/Regexp/Token/NoOp.pm", - "version" : "0.085" + "version" : "0.086" }, "PPIx::Regexp::Token::Operator" : { "file" : "lib/PPIx/Regexp/Token/Operator.pm", - "version" : "0.085" + "version" : "0.086" }, "PPIx::Regexp::Token::Quantifier" : { "file" : "lib/PPIx/Regexp/Token/Quantifier.pm", - "version" : "0.085" + "version" : "0.086" }, "PPIx::Regexp::Token::Recursion" : { "file" : "lib/PPIx/Regexp/Token/Recursion.pm", - "version" : "0.085" + "version" : "0.086" }, "PPIx::Regexp::Token::Reference" : { "file" : "lib/PPIx/Regexp/Token/Reference.pm", - "version" : "0.085" + "version" : "0.086" }, "PPIx::Regexp::Token::Structure" : { "file" : "lib/PPIx/Regexp/Token/Structure.pm", - "version" : "0.085" + "version" : "0.086" }, "PPIx::Regexp::Token::Unknown" : { "file" : "lib/PPIx/Regexp/Token/Unknown.pm", - "version" : "0.085" + "version" : "0.086" }, "PPIx::Regexp::Token::Unmatched" : { "file" : "lib/PPIx/Regexp/Token/Unmatched.pm", - "version" : "0.085" + "version" : "0.086" }, "PPIx::Regexp::Token::Whitespace" : { "file" : "lib/PPIx/Regexp/Token/Whitespace.pm", - "version" : "0.085" + "version" : "0.086" }, "PPIx::Regexp::Tokenizer" : { "file" : "lib/PPIx/Regexp/Tokenizer.pm", - "version" : "0.085" + "version" : "0.086" }, "PPIx::Regexp::Util" : { "file" : "lib/PPIx/Regexp/Util.pm", - "version" : "0.085" + "version" : "0.086" } }, "release_status" : "stable", @@ -333,6 +338,6 @@ "web" : "https://github.com/trwyant/perl-PPIx-Regexp" } }, - "version" : "0.085", - "x_serialization_backend" : "JSON::PP version 4.08" + "version" : "0.086", + "x_serialization_backend" : "JSON::PP version 4.12" } diff -Nru libppix-regexp-perl-0.085/META.yml libppix-regexp-perl-0.086/META.yml --- libppix-regexp-perl-0.085/META.yml 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/META.yml 2022-12-13 14:26:59.000000000 +0000 @@ -12,7 +12,7 @@ strict: '0' warnings: '0' dynamic_config: 1 -generated_by: 'Module::Build version 0.4231, CPAN::Meta::Converter version 2.150010' +generated_by: 'Module::Build version 0.4232, CPAN::Meta::Converter version 2.150010' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html @@ -28,199 +28,202 @@ provides: PPIx::Regexp: file: lib/PPIx/Regexp.pm - version: '0.085' + version: '0.086' PPIx::Regexp::Constant: file: lib/PPIx/Regexp/Constant.pm - version: '0.085' + version: 0.085_04 + PPIx::Regexp::Constant::Inf: + file: lib/PPIx/Regexp/Constant.pm + version: '0.086' PPIx::Regexp::Dumper: file: lib/PPIx/Regexp/Dumper.pm - version: '0.085' + version: '0.086' PPIx::Regexp::Element: file: lib/PPIx/Regexp/Element.pm - version: '0.085' + version: '0.086' PPIx::Regexp::Lexer: file: lib/PPIx/Regexp/Lexer.pm - version: '0.085' + version: '0.086' PPIx::Regexp::Node: file: lib/PPIx/Regexp/Node.pm - version: '0.085' + version: '0.086' PPIx::Regexp::Node::Range: file: lib/PPIx/Regexp/Node/Range.pm - version: '0.085' + version: '0.086' PPIx::Regexp::Node::Unknown: file: lib/PPIx/Regexp/Node/Unknown.pm - version: '0.085' + version: '0.086' PPIx::Regexp::Structure: file: lib/PPIx/Regexp/Structure.pm - version: '0.085' + version: '0.086' PPIx::Regexp::Structure::Assertion: file: lib/PPIx/Regexp/Structure/Assertion.pm - version: '0.085' + version: '0.086' PPIx::Regexp::Structure::Atomic_Script_Run: file: lib/PPIx/Regexp/Structure/Atomic_Script_Run.pm - version: '0.085' + version: '0.086' PPIx::Regexp::Structure::BranchReset: file: lib/PPIx/Regexp/Structure/BranchReset.pm - version: '0.085' + version: '0.086' PPIx::Regexp::Structure::Capture: file: lib/PPIx/Regexp/Structure/Capture.pm - version: '0.085' + version: '0.086' PPIx::Regexp::Structure::CharClass: file: lib/PPIx/Regexp/Structure/CharClass.pm - version: '0.085' + version: '0.086' PPIx::Regexp::Structure::Code: file: lib/PPIx/Regexp/Structure/Code.pm - version: '0.085' + version: '0.086' PPIx::Regexp::Structure::Main: file: lib/PPIx/Regexp/Structure/Main.pm - version: '0.085' + version: '0.086' PPIx::Regexp::Structure::Modifier: file: lib/PPIx/Regexp/Structure/Modifier.pm - version: '0.085' + version: '0.086' PPIx::Regexp::Structure::NamedCapture: file: lib/PPIx/Regexp/Structure/NamedCapture.pm - version: '0.085' + version: '0.086' PPIx::Regexp::Structure::Quantifier: file: lib/PPIx/Regexp/Structure/Quantifier.pm - version: '0.085' + version: '0.086' PPIx::Regexp::Structure::RegexSet: file: lib/PPIx/Regexp/Structure/RegexSet.pm - version: '0.085' + version: '0.086' PPIx::Regexp::Structure::Regexp: file: lib/PPIx/Regexp/Structure/Regexp.pm - version: '0.085' + version: '0.086' PPIx::Regexp::Structure::Replacement: file: lib/PPIx/Regexp/Structure/Replacement.pm - version: '0.085' + version: '0.086' PPIx::Regexp::Structure::Script_Run: file: lib/PPIx/Regexp/Structure/Script_Run.pm - version: '0.085' + version: '0.086' PPIx::Regexp::Structure::Subexpression: file: lib/PPIx/Regexp/Structure/Subexpression.pm - version: '0.085' + version: '0.086' PPIx::Regexp::Structure::Switch: file: lib/PPIx/Regexp/Structure/Switch.pm - version: '0.085' + version: '0.086' PPIx::Regexp::Structure::Unknown: file: lib/PPIx/Regexp/Structure/Unknown.pm - version: '0.085' + version: '0.086' PPIx::Regexp::Support: file: lib/PPIx/Regexp/Support.pm - version: '0.085' + version: '0.086' PPIx::Regexp::Token: file: lib/PPIx/Regexp/Token.pm - version: '0.085' + version: '0.086' PPIx::Regexp::Token::Assertion: file: lib/PPIx/Regexp/Token/Assertion.pm - version: '0.085' + version: '0.086' PPIx::Regexp::Token::Backreference: file: lib/PPIx/Regexp/Token/Backreference.pm - version: '0.085' + version: '0.086' PPIx::Regexp::Token::Backtrack: file: lib/PPIx/Regexp/Token/Backtrack.pm - version: '0.085' + version: '0.086' PPIx::Regexp::Token::CharClass: file: lib/PPIx/Regexp/Token/CharClass.pm - version: '0.085' + version: '0.086' PPIx::Regexp::Token::CharClass::POSIX: file: lib/PPIx/Regexp/Token/CharClass/POSIX.pm - version: '0.085' + version: '0.086' PPIx::Regexp::Token::CharClass::POSIX::Unknown: file: lib/PPIx/Regexp/Token/CharClass/POSIX/Unknown.pm - version: '0.085' + version: '0.086' PPIx::Regexp::Token::CharClass::Simple: file: lib/PPIx/Regexp/Token/CharClass/Simple.pm - version: '0.085' + version: '0.086' PPIx::Regexp::Token::Code: file: lib/PPIx/Regexp/Token/Code.pm - version: '0.085' + version: '0.086' PPIx::Regexp::Token::Comment: file: lib/PPIx/Regexp/Token/Comment.pm - version: '0.085' + version: '0.086' PPIx::Regexp::Token::Condition: file: lib/PPIx/Regexp/Token/Condition.pm - version: '0.085' + version: '0.086' PPIx::Regexp::Token::Control: file: lib/PPIx/Regexp/Token/Control.pm - version: '0.085' + version: '0.086' PPIx::Regexp::Token::Delimiter: file: lib/PPIx/Regexp/Token/Delimiter.pm - version: '0.085' + version: '0.086' PPIx::Regexp::Token::Greediness: file: lib/PPIx/Regexp/Token/Greediness.pm - version: '0.085' + version: '0.086' PPIx::Regexp::Token::GroupType: file: lib/PPIx/Regexp/Token/GroupType.pm - version: '0.085' + version: '0.086' PPIx::Regexp::Token::GroupType::Assertion: file: lib/PPIx/Regexp/Token/GroupType/Assertion.pm - version: '0.085' + version: '0.086' PPIx::Regexp::Token::GroupType::Atomic_Script_Run: file: lib/PPIx/Regexp/Token/GroupType/Atomic_Script_Run.pm - version: '0.085' + version: '0.086' PPIx::Regexp::Token::GroupType::BranchReset: file: lib/PPIx/Regexp/Token/GroupType/BranchReset.pm - version: '0.085' + version: '0.086' PPIx::Regexp::Token::GroupType::Code: file: lib/PPIx/Regexp/Token/GroupType/Code.pm - version: '0.085' + version: '0.086' PPIx::Regexp::Token::GroupType::Modifier: file: lib/PPIx/Regexp/Token/GroupType/Modifier.pm - version: '0.085' + version: '0.086' PPIx::Regexp::Token::GroupType::NamedCapture: file: lib/PPIx/Regexp/Token/GroupType/NamedCapture.pm - version: '0.085' + version: '0.086' PPIx::Regexp::Token::GroupType::Script_Run: file: lib/PPIx/Regexp/Token/GroupType/Script_Run.pm - version: '0.085' + version: '0.086' PPIx::Regexp::Token::GroupType::Subexpression: file: lib/PPIx/Regexp/Token/GroupType/Subexpression.pm - version: '0.085' + version: '0.086' PPIx::Regexp::Token::GroupType::Switch: file: lib/PPIx/Regexp/Token/GroupType/Switch.pm - version: '0.085' + version: '0.086' PPIx::Regexp::Token::Interpolation: file: lib/PPIx/Regexp/Token/Interpolation.pm - version: '0.085' + version: '0.086' PPIx::Regexp::Token::Literal: file: lib/PPIx/Regexp/Token/Literal.pm - version: '0.085' + version: '0.086' PPIx::Regexp::Token::Modifier: file: lib/PPIx/Regexp/Token/Modifier.pm - version: '0.085' + version: '0.086' PPIx::Regexp::Token::NoOp: file: lib/PPIx/Regexp/Token/NoOp.pm - version: '0.085' + version: '0.086' PPIx::Regexp::Token::Operator: file: lib/PPIx/Regexp/Token/Operator.pm - version: '0.085' + version: '0.086' PPIx::Regexp::Token::Quantifier: file: lib/PPIx/Regexp/Token/Quantifier.pm - version: '0.085' + version: '0.086' PPIx::Regexp::Token::Recursion: file: lib/PPIx/Regexp/Token/Recursion.pm - version: '0.085' + version: '0.086' PPIx::Regexp::Token::Reference: file: lib/PPIx/Regexp/Token/Reference.pm - version: '0.085' + version: '0.086' PPIx::Regexp::Token::Structure: file: lib/PPIx/Regexp/Token/Structure.pm - version: '0.085' + version: '0.086' PPIx::Regexp::Token::Unknown: file: lib/PPIx/Regexp/Token/Unknown.pm - version: '0.085' + version: '0.086' PPIx::Regexp::Token::Unmatched: file: lib/PPIx/Regexp/Token/Unmatched.pm - version: '0.085' + version: '0.086' PPIx::Regexp::Token::Whitespace: file: lib/PPIx/Regexp/Token/Whitespace.pm - version: '0.085' + version: '0.086' PPIx::Regexp::Tokenizer: file: lib/PPIx/Regexp/Tokenizer.pm - version: '0.085' + version: '0.086' PPIx::Regexp::Util: file: lib/PPIx/Regexp/Util.pm - version: '0.085' + version: '0.086' requires: Carp: '0' Encode: '0' @@ -232,6 +235,7 @@ Task::Weaken: '0' base: '0' constant: '0' + overload: '0' perl: '5.006' strict: '0' warnings: '0' @@ -239,5 +243,5 @@ bugtracker: https://rt.cpan.org/Public/Dist/Display.html?Name=PPIx-Regexp license: http://dev.perl.org/licenses/ repository: git://github.com/trwyant/perl-PPIx-Regexp.git -version: '0.085' +version: '0.086' x_serialization_backend: 'CPAN::Meta::YAML version 0.018' diff -Nru libppix-regexp-perl-0.085/t/basic.t libppix-regexp-perl-0.086/t/basic.t --- libppix-regexp-perl-0.085/t/basic.t 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/t/basic.t 2022-12-13 14:26:59.000000000 +0000 @@ -20,7 +20,7 @@ require_ok( 'PPIx::Regexp' ) or BAIL_OUT; class_isa_ok( 'PPIx::Regexp', 'PPIx::Regexp::Node' ) or BAIL_OUT; -require_ok( 'PPIx::Regexp::Constant' ); +require_ok( 'PPIx::Regexp::Constant' ) or BAIL_OUT; class_isa_ok( 'PPIx::Regexp::Constant', 'Exporter' ); require_ok( 'PPIx::Regexp::Dumper' ) or BAIL_OUT; diff -Nru libppix-regexp-perl-0.085/t/inf.t libppix-regexp-perl-0.086/t/inf.t --- libppix-regexp-perl-0.085/t/inf.t 1970-01-01 00:00:00.000000000 +0000 +++ libppix-regexp-perl-0.086/t/inf.t 2022-12-13 14:26:59.000000000 +0000 @@ -0,0 +1,32 @@ +package main; + +use 5.006; + +use strict; +use warnings; + +use PPIx::Regexp::Constant; # This gets us ::Inf +use Test::More 0.88; # Because of done_testing(); + +use constant BIG => 6.02e23; # An arbitrary large number + +# DANGER WILL ROBINSON! ENCAPSULATION VIOLATION! +use constant INF => PPIx::Regexp::Constant::Inf->__pos_inf(); + +ok INF, 'Inf is true'; + +is INF, 'Inf', q; + +cmp_ok INF, '==', INF, 'Inf is equal to itself'; + +cmp_ok INF, '>', BIG, 'Inf is greater than a large number'; + +cmp_ok INF + BIG, '==', INF, 'Inf plus a large number is still Inf'; + +cmp_ok INF - BIG, '==', INF, 'Inf minus a large number is still Inf'; + +done_testing; + +1; + +# ex: set textwidth=72 : diff -Nru libppix-regexp-perl-0.085/t/version.t libppix-regexp-perl-0.086/t/version.t --- libppix-regexp-perl-0.085/t/version.t 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/t/version.t 2022-12-13 14:26:59.000000000 +0000 @@ -829,7 +829,11 @@ [ '(?=f?)', '5.000', undef, 'Variable-length look-ahead' ], [ '(?=f{1,2})', '5.000', undef, 'Variable-length look-ahead' ], [ '(?<=f?)', '5.029009', undef, 'Variable-length look-behind' ], - [ '(?<=f{1,2})', '5.029009', undef, 'Variable-length look-behind' ], + [ '(?<=f{1,2})', '5.029009', undef, + 'Variable-length look-behind' ], + [ '(?<=a|bc)', '5.029009', undef, 'Variable-length look-behind' ], + [ '(?<=$foo|$bar)', '5.000', undef, + 'Indeterminite-length look-behind' ], [ '(?(?=(?=x)x)\K)', '5.009005', undef, '\K not really in look-ahead' ], [ '(?(?=(?=x)x\K))', '5.009005', '5.031003', '\K nested one deep' ], [ '(?(?=(?=x\K)x))', '5.009005', '5.031003', '\K nested two deep' ], diff -Nru libppix-regexp-perl-0.085/t/width.t libppix-regexp-perl-0.086/t/width.t --- libppix-regexp-perl-0.085/t/width.t 1970-01-01 00:00:00.000000000 +0000 +++ libppix-regexp-perl-0.086/t/width.t 2022-12-13 14:26:59.000000000 +0000 @@ -0,0 +1,2820 @@ +package main; + +use 5.006; + +use strict; +use warnings; + +use Test::More 0.88; # Because of done_testing(); + +use lib qw{ inc }; +use My::Module::Test; + + +note 'Literals'; + +parse ( '/x/' ); +value ( failures => [], 0 ); +klass ( 'PPIx::Regexp' ); +count ( 3 ); +raw_width( 1, 1 ); +width ( 1, 1 ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +choose ( child => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( '' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); +choose ( child => 1 ); +klass ( 'PPIx::Regexp::Structure::Regexp' ); +count ( 1 ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 1, start => [] ); +count ( 1 ); +choose ( child => 1, start => 0 ); +klass ( 'PPIx::Regexp::Token::Delimiter' ); +content ( '/' ); +choose ( child => 1, type => [] ); +count ( 0 ); +choose ( child => 1, finish => [] ); +count ( 1 ); +choose ( child => 1, finish => 0 ); +klass ( 'PPIx::Regexp::Token::Delimiter' ); +content ( '/' ); +choose ( child => 1, child => 0 ); +klass ( 'PPIx::Regexp::Token::Literal' ); +content ( 'x' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 2 ); +klass ( 'PPIx::Regexp::Token::Modifier' ); +content ( '' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); + + +note 'Character classes'; + +parse ( '/\\w/' ); +value ( failures => [], 0 ); +klass ( 'PPIx::Regexp' ); +count ( 3 ); +raw_width( 1, 1 ); +width ( 1, 1 ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +choose ( child => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( '' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); +choose ( child => 1 ); +klass ( 'PPIx::Regexp::Structure::Regexp' ); +count ( 1 ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 1, start => [] ); +count ( 1 ); +choose ( child => 1, start => 0 ); +klass ( 'PPIx::Regexp::Token::Delimiter' ); +content ( '/' ); +choose ( child => 1, type => [] ); +count ( 0 ); +choose ( child => 1, finish => [] ); +count ( 1 ); +choose ( child => 1, finish => 0 ); +klass ( 'PPIx::Regexp::Token::Delimiter' ); +content ( '/' ); +choose ( child => 1, child => 0 ); +klass ( 'PPIx::Regexp::Token::CharClass::Simple' ); +content ( '\\w' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 2 ); +klass ( 'PPIx::Regexp::Token::Modifier' ); +content ( '' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); + +parse ( '/[xy]/' ); +value ( failures => [], 0 ); +klass ( 'PPIx::Regexp' ); +count ( 3 ); +raw_width( 1, 1 ); +width ( 1, 1 ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +choose ( child => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( '' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); +choose ( child => 1 ); +klass ( 'PPIx::Regexp::Structure::Regexp' ); +count ( 1 ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 1, start => [] ); +count ( 1 ); +choose ( child => 1, start => 0 ); +klass ( 'PPIx::Regexp::Token::Delimiter' ); +content ( '/' ); +choose ( child => 1, type => [] ); +count ( 0 ); +choose ( child => 1, finish => [] ); +count ( 1 ); +choose ( child => 1, finish => 0 ); +klass ( 'PPIx::Regexp::Token::Delimiter' ); +content ( '/' ); +choose ( child => 1, child => 0 ); +klass ( 'PPIx::Regexp::Structure::CharClass' ); +count ( 2 ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 1, child => 0, start => [] ); +count ( 1 ); +choose ( child => 1, child => 0, start => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( '[' ); +choose ( child => 1, child => 0, type => [] ); +count ( 0 ); +choose ( child => 1, child => 0, finish => [] ); +count ( 1 ); +choose ( child => 1, child => 0, finish => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( ']' ); +choose ( child => 1, child => 0, child => 0 ); +klass ( 'PPIx::Regexp::Token::Literal' ); +content ( 'x' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 1, child => 0, child => 1 ); +klass ( 'PPIx::Regexp::Token::Literal' ); +content ( 'y' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 2 ); +klass ( 'PPIx::Regexp::Token::Modifier' ); +content ( '' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); + +parse ( '/(?[ \\w | [.] ])/' ); +value ( failures => [], 0 ); +klass ( 'PPIx::Regexp' ); +count ( 3 ); +raw_width( 1, 1 ); +width ( 1, 1 ); +value ( perl_version_introduced => [], '5.017008' ); +value ( perl_version_removed => [], undef ); +choose ( child => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( '' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); +choose ( child => 1 ); +klass ( 'PPIx::Regexp::Structure::Regexp' ); +count ( 1 ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 1, start => [] ); +count ( 1 ); +choose ( child => 1, start => 0 ); +klass ( 'PPIx::Regexp::Token::Delimiter' ); +content ( '/' ); +choose ( child => 1, type => [] ); +count ( 0 ); +choose ( child => 1, finish => [] ); +count ( 1 ); +choose ( child => 1, finish => 0 ); +klass ( 'PPIx::Regexp::Token::Delimiter' ); +content ( '/' ); +choose ( child => 1, child => 0 ); +klass ( 'PPIx::Regexp::Structure::RegexSet' ); +count ( 6 ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 1, child => 0, start => [] ); +count ( 2 ); +choose ( child => 1, child => 0, start => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( '(?[' ); +choose ( child => 1, child => 0, start => 1 ); +klass ( 'PPIx::Regexp::Token::Whitespace' ); +content ( ' ' ); +choose ( child => 1, child => 0, type => [] ); +count ( 0 ); +choose ( child => 1, child => 0, finish => [] ); +count ( 1 ); +choose ( child => 1, child => 0, finish => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( '])' ); +choose ( child => 1, child => 0, child => 0 ); +klass ( 'PPIx::Regexp::Token::CharClass::Simple' ); +content ( '\\w' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 1, child => 0, child => 1 ); +klass ( 'PPIx::Regexp::Token::Whitespace' ); +content ( ' ' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); +choose ( child => 1, child => 0, child => 2 ); +klass ( 'PPIx::Regexp::Token::Operator' ); +content ( '|' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); +choose ( child => 1, child => 0, child => 3 ); +klass ( 'PPIx::Regexp::Token::Whitespace' ); +content ( ' ' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); +choose ( child => 1, child => 0, child => 4 ); +klass ( 'PPIx::Regexp::Structure::CharClass' ); +count ( 1 ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 1, child => 0, child => 4, start => [] ); +count ( 1 ); +choose ( child => 1, child => 0, child => 4, start => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( '[' ); +choose ( child => 1, child => 0, child => 4, type => [] ); +count ( 0 ); +choose ( child => 1, child => 0, child => 4, finish => [] ); +count ( 1 ); +choose ( child => 1, child => 0, child => 4, finish => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( ']' ); +choose ( child => 1, child => 0, child => 4, child => 0 ); +klass ( 'PPIx::Regexp::Token::Literal' ); +content ( '.' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 1, child => 0, child => 5 ); +klass ( 'PPIx::Regexp::Token::Whitespace' ); +content ( ' ' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); +choose ( child => 2 ); +klass ( 'PPIx::Regexp::Token::Modifier' ); +content ( '' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); + + +note 'Quantifiers'; + +parse ( '/x?/' ); +value ( failures => [], 0 ); +klass ( 'PPIx::Regexp' ); +count ( 3 ); +raw_width( 0, 1 ); +width ( 0, 1 ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +choose ( child => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( '' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); +choose ( child => 1 ); +klass ( 'PPIx::Regexp::Structure::Regexp' ); +count ( 2 ); +raw_width( 0, 1 ); +width ( 0, 1 ); +choose ( child => 1, start => [] ); +count ( 1 ); +choose ( child => 1, start => 0 ); +klass ( 'PPIx::Regexp::Token::Delimiter' ); +content ( '/' ); +choose ( child => 1, type => [] ); +count ( 0 ); +choose ( child => 1, finish => [] ); +count ( 1 ); +choose ( child => 1, finish => 0 ); +klass ( 'PPIx::Regexp::Token::Delimiter' ); +content ( '/' ); +choose ( child => 1, child => 0 ); +klass ( 'PPIx::Regexp::Token::Literal' ); +content ( 'x' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 1, 1 ); +width ( 0, 1 ); +choose ( child => 1, child => 1 ); +klass ( 'PPIx::Regexp::Token::Quantifier' ); +content ( '?' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); +choose ( child => 2 ); +klass ( 'PPIx::Regexp::Token::Modifier' ); +content ( '' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); + +parse ( '/x*/' ); +value ( failures => [], 0 ); +klass ( 'PPIx::Regexp' ); +count ( 3 ); +raw_width( 0, INFINITY ); +width ( 0, INFINITY ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +choose ( child => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( '' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); +choose ( child => 1 ); +klass ( 'PPIx::Regexp::Structure::Regexp' ); +count ( 2 ); +raw_width( 0, INFINITY ); +width ( 0, INFINITY ); +choose ( child => 1, start => [] ); +count ( 1 ); +choose ( child => 1, start => 0 ); +klass ( 'PPIx::Regexp::Token::Delimiter' ); +content ( '/' ); +choose ( child => 1, type => [] ); +count ( 0 ); +choose ( child => 1, finish => [] ); +count ( 1 ); +choose ( child => 1, finish => 0 ); +klass ( 'PPIx::Regexp::Token::Delimiter' ); +content ( '/' ); +choose ( child => 1, child => 0 ); +klass ( 'PPIx::Regexp::Token::Literal' ); +content ( 'x' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 1, 1 ); +width ( 0, INFINITY ); +choose ( child => 1, child => 1 ); +klass ( 'PPIx::Regexp::Token::Quantifier' ); +content ( '*' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); +choose ( child => 2 ); +klass ( 'PPIx::Regexp::Token::Modifier' ); +content ( '' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); + +parse ( '/x+/' ); +value ( failures => [], 0 ); +klass ( 'PPIx::Regexp' ); +count ( 3 ); +raw_width( 1, INFINITY ); +width ( 1, INFINITY ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +choose ( child => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( '' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); +choose ( child => 1 ); +klass ( 'PPIx::Regexp::Structure::Regexp' ); +count ( 2 ); +raw_width( 1, INFINITY ); +width ( 1, INFINITY ); +choose ( child => 1, start => [] ); +count ( 1 ); +choose ( child => 1, start => 0 ); +klass ( 'PPIx::Regexp::Token::Delimiter' ); +content ( '/' ); +choose ( child => 1, type => [] ); +count ( 0 ); +choose ( child => 1, finish => [] ); +count ( 1 ); +choose ( child => 1, finish => 0 ); +klass ( 'PPIx::Regexp::Token::Delimiter' ); +content ( '/' ); +choose ( child => 1, child => 0 ); +klass ( 'PPIx::Regexp::Token::Literal' ); +content ( 'x' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 1, 1 ); +width ( 1, INFINITY ); +choose ( child => 1, child => 1 ); +klass ( 'PPIx::Regexp::Token::Quantifier' ); +content ( '+' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); +choose ( child => 2 ); +klass ( 'PPIx::Regexp::Token::Modifier' ); +content ( '' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); + +parse ( '/x{2}/' ); +value ( failures => [], 0 ); +klass ( 'PPIx::Regexp' ); +count ( 3 ); +raw_width( 2, 2 ); +width ( 2, 2 ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +choose ( child => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( '' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); +choose ( child => 1 ); +klass ( 'PPIx::Regexp::Structure::Regexp' ); +count ( 2 ); +raw_width( 2, 2 ); +width ( 2, 2 ); +choose ( child => 1, start => [] ); +count ( 1 ); +choose ( child => 1, start => 0 ); +klass ( 'PPIx::Regexp::Token::Delimiter' ); +content ( '/' ); +choose ( child => 1, type => [] ); +count ( 0 ); +choose ( child => 1, finish => [] ); +count ( 1 ); +choose ( child => 1, finish => 0 ); +klass ( 'PPIx::Regexp::Token::Delimiter' ); +content ( '/' ); +choose ( child => 1, child => 0 ); +klass ( 'PPIx::Regexp::Token::Literal' ); +content ( 'x' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 1, 1 ); +width ( 2, 2 ); +choose ( child => 1, child => 1 ); +klass ( 'PPIx::Regexp::Structure::Quantifier' ); +count ( 1 ); +raw_width( 1, 1 ); +width ( 0, 0 ); +choose ( child => 1, child => 1, start => [] ); +count ( 1 ); +choose ( child => 1, child => 1, start => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( '{' ); +choose ( child => 1, child => 1, type => [] ); +count ( 0 ); +choose ( child => 1, child => 1, finish => [] ); +count ( 1 ); +choose ( child => 1, child => 1, finish => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( '}' ); +choose ( child => 1, child => 1, child => 0 ); +klass ( 'PPIx::Regexp::Token::Literal' ); +content ( 2 ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 2 ); +klass ( 'PPIx::Regexp::Token::Modifier' ); +content ( '' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); + +parse ( '/x{2,3}/' ); +value ( failures => [], 0 ); +klass ( 'PPIx::Regexp' ); +count ( 3 ); +raw_width( 2, 3 ); +width ( 2, 3 ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +choose ( child => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( '' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); +choose ( child => 1 ); +klass ( 'PPIx::Regexp::Structure::Regexp' ); +count ( 2 ); +raw_width( 2, 3 ); +width ( 2, 3 ); +choose ( child => 1, start => [] ); +count ( 1 ); +choose ( child => 1, start => 0 ); +klass ( 'PPIx::Regexp::Token::Delimiter' ); +content ( '/' ); +choose ( child => 1, type => [] ); +count ( 0 ); +choose ( child => 1, finish => [] ); +count ( 1 ); +choose ( child => 1, finish => 0 ); +klass ( 'PPIx::Regexp::Token::Delimiter' ); +content ( '/' ); +choose ( child => 1, child => 0 ); +klass ( 'PPIx::Regexp::Token::Literal' ); +content ( 'x' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 1, 1 ); +width ( 2, 3 ); +choose ( child => 1, child => 1 ); +klass ( 'PPIx::Regexp::Structure::Quantifier' ); +count ( 3 ); +raw_width( 3, 3 ); +width ( 0, 0 ); +choose ( child => 1, child => 1, start => [] ); +count ( 1 ); +choose ( child => 1, child => 1, start => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( '{' ); +choose ( child => 1, child => 1, type => [] ); +count ( 0 ); +choose ( child => 1, child => 1, finish => [] ); +count ( 1 ); +choose ( child => 1, child => 1, finish => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( '}' ); +choose ( child => 1, child => 1, child => 0 ); +klass ( 'PPIx::Regexp::Token::Literal' ); +content ( 2 ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 1, child => 1, child => 1 ); +klass ( 'PPIx::Regexp::Token::Literal' ); +content ( ',' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 1, child => 1, child => 2 ); +klass ( 'PPIx::Regexp::Token::Literal' ); +content ( 3 ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 2 ); +klass ( 'PPIx::Regexp::Token::Modifier' ); +content ( '' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); + +parse ( '/x{2,}/' ); +value ( failures => [], 0 ); +klass ( 'PPIx::Regexp' ); +count ( 3 ); +raw_width( 2, INFINITY ); +width ( 2, INFINITY ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +choose ( child => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( '' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); +choose ( child => 1 ); +klass ( 'PPIx::Regexp::Structure::Regexp' ); +count ( 2 ); +raw_width( 2, INFINITY ); +width ( 2, INFINITY ); +choose ( child => 1, start => [] ); +count ( 1 ); +choose ( child => 1, start => 0 ); +klass ( 'PPIx::Regexp::Token::Delimiter' ); +content ( '/' ); +choose ( child => 1, type => [] ); +count ( 0 ); +choose ( child => 1, finish => [] ); +count ( 1 ); +choose ( child => 1, finish => 0 ); +klass ( 'PPIx::Regexp::Token::Delimiter' ); +content ( '/' ); +choose ( child => 1, child => 0 ); +klass ( 'PPIx::Regexp::Token::Literal' ); +content ( 'x' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 1, 1 ); +width ( 2, INFINITY ); +choose ( child => 1, child => 1 ); +klass ( 'PPIx::Regexp::Structure::Quantifier' ); +count ( 2 ); +raw_width( 2, 2 ); +width ( 0, 0 ); +choose ( child => 1, child => 1, start => [] ); +count ( 1 ); +choose ( child => 1, child => 1, start => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( '{' ); +choose ( child => 1, child => 1, type => [] ); +count ( 0 ); +choose ( child => 1, child => 1, finish => [] ); +count ( 1 ); +choose ( child => 1, child => 1, finish => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( '}' ); +choose ( child => 1, child => 1, child => 0 ); +klass ( 'PPIx::Regexp::Token::Literal' ); +content ( 2 ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 1, child => 1, child => 1 ); +klass ( 'PPIx::Regexp::Token::Literal' ); +content ( ',' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 2 ); +klass ( 'PPIx::Regexp::Token::Modifier' ); +content ( '' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); + +parse ( '/x{,3}/' ); +value ( failures => [], 0 ); +klass ( 'PPIx::Regexp' ); +count ( 3 ); +raw_width( 0, 3 ); +width ( 0, 3 ); +value ( perl_version_introduced => [], '5.033006' ); +value ( perl_version_removed => [], undef ); +choose ( child => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( '' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); +choose ( child => 1 ); +klass ( 'PPIx::Regexp::Structure::Regexp' ); +count ( 2 ); +raw_width( 0, 3 ); +width ( 0, 3 ); +choose ( child => 1, start => [] ); +count ( 1 ); +choose ( child => 1, start => 0 ); +klass ( 'PPIx::Regexp::Token::Delimiter' ); +content ( '/' ); +choose ( child => 1, type => [] ); +count ( 0 ); +choose ( child => 1, finish => [] ); +count ( 1 ); +choose ( child => 1, finish => 0 ); +klass ( 'PPIx::Regexp::Token::Delimiter' ); +content ( '/' ); +choose ( child => 1, child => 0 ); +klass ( 'PPIx::Regexp::Token::Literal' ); +content ( 'x' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 1, 1 ); +width ( 0, 3 ); +choose ( child => 1, child => 1 ); +klass ( 'PPIx::Regexp::Structure::Quantifier' ); +count ( 2 ); +raw_width( 2, 2 ); +width ( 0, 0 ); +choose ( child => 1, child => 1, start => [] ); +count ( 1 ); +choose ( child => 1, child => 1, start => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( '{' ); +choose ( child => 1, child => 1, type => [] ); +count ( 0 ); +choose ( child => 1, child => 1, finish => [] ); +count ( 1 ); +choose ( child => 1, child => 1, finish => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( '}' ); +choose ( child => 1, child => 1, child => 0 ); +klass ( 'PPIx::Regexp::Token::Literal' ); +content ( ',' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 1, child => 1, child => 1 ); +klass ( 'PPIx::Regexp::Token::Literal' ); +content ( 3 ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 2 ); +klass ( 'PPIx::Regexp::Token::Modifier' ); +content ( '' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); + +parse ( '/x{,$foo}/' ); +value ( failures => [], 0 ); +klass ( 'PPIx::Regexp' ); +count ( 3 ); +raw_width( 0, undef ); +width ( 0, undef ); +value ( perl_version_introduced => [], '5.033006' ); +value ( perl_version_removed => [], undef ); +choose ( child => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( '' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); +choose ( child => 1 ); +klass ( 'PPIx::Regexp::Structure::Regexp' ); +count ( 2 ); +raw_width( 0, undef ); +width ( 0, undef ); +choose ( child => 1, start => [] ); +count ( 1 ); +choose ( child => 1, start => 0 ); +klass ( 'PPIx::Regexp::Token::Delimiter' ); +content ( '/' ); +choose ( child => 1, type => [] ); +count ( 0 ); +choose ( child => 1, finish => [] ); +count ( 1 ); +choose ( child => 1, finish => 0 ); +klass ( 'PPIx::Regexp::Token::Delimiter' ); +content ( '/' ); +choose ( child => 1, child => 0 ); +klass ( 'PPIx::Regexp::Token::Literal' ); +content ( 'x' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 1, 1 ); +width ( 0, undef ); +choose ( child => 1, child => 1 ); +klass ( 'PPIx::Regexp::Structure::Quantifier' ); +count ( 2 ); +raw_width( undef, undef ); +width ( 0, 0 ); +choose ( child => 1, child => 1, start => [] ); +count ( 1 ); +choose ( child => 1, child => 1, start => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( '{' ); +choose ( child => 1, child => 1, type => [] ); +count ( 0 ); +choose ( child => 1, child => 1, finish => [] ); +count ( 1 ); +choose ( child => 1, child => 1, finish => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( '}' ); +choose ( child => 1, child => 1, child => 0 ); +klass ( 'PPIx::Regexp::Token::Literal' ); +content ( ',' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 1, child => 1, child => 1 ); +klass ( 'PPIx::Regexp::Token::Interpolation' ); +content ( '$foo' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( undef, undef ); +choose ( child => 2 ); +klass ( 'PPIx::Regexp::Token::Modifier' ); +content ( '' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); + +parse ( '/(xy?)/' ); +value ( failures => [], 0 ); +klass ( 'PPIx::Regexp' ); +count ( 3 ); +raw_width( 1, 2 ); +width ( 1, 2 ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +choose ( child => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( '' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); +choose ( child => 1 ); +klass ( 'PPIx::Regexp::Structure::Regexp' ); +count ( 1 ); +raw_width( 1, 2 ); +width ( 1, 2 ); +choose ( child => 1, start => [] ); +count ( 1 ); +choose ( child => 1, start => 0 ); +klass ( 'PPIx::Regexp::Token::Delimiter' ); +content ( '/' ); +choose ( child => 1, type => [] ); +count ( 0 ); +choose ( child => 1, finish => [] ); +count ( 1 ); +choose ( child => 1, finish => 0 ); +klass ( 'PPIx::Regexp::Token::Delimiter' ); +content ( '/' ); +choose ( child => 1, child => 0 ); +klass ( 'PPIx::Regexp::Structure::Capture' ); +count ( 3 ); +raw_width( 1, 2 ); +width ( 1, 2 ); +choose ( child => 1, child => 0, start => [] ); +count ( 1 ); +choose ( child => 1, child => 0, start => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( '(' ); +choose ( child => 1, child => 0, type => [] ); +count ( 0 ); +choose ( child => 1, child => 0, finish => [] ); +count ( 1 ); +choose ( child => 1, child => 0, finish => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( ')' ); +choose ( child => 1, child => 0, child => 0 ); +klass ( 'PPIx::Regexp::Token::Literal' ); +content ( 'x' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 1, child => 0, child => 1 ); +klass ( 'PPIx::Regexp::Token::Literal' ); +content ( 'y' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 1, 1 ); +width ( 0, 1 ); +choose ( child => 1, child => 0, child => 2 ); +klass ( 'PPIx::Regexp::Token::Quantifier' ); +content ( '?' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); +choose ( child => 2 ); +klass ( 'PPIx::Regexp::Token::Modifier' ); +content ( '' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); + +parse ( '/(xy)?/' ); +value ( failures => [], 0 ); +klass ( 'PPIx::Regexp' ); +count ( 3 ); +raw_width( 0, 2 ); +width ( 0, 2 ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +choose ( child => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( '' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); +choose ( child => 1 ); +klass ( 'PPIx::Regexp::Structure::Regexp' ); +count ( 2 ); +raw_width( 0, 2 ); +width ( 0, 2 ); +choose ( child => 1, start => [] ); +count ( 1 ); +choose ( child => 1, start => 0 ); +klass ( 'PPIx::Regexp::Token::Delimiter' ); +content ( '/' ); +choose ( child => 1, type => [] ); +count ( 0 ); +choose ( child => 1, finish => [] ); +count ( 1 ); +choose ( child => 1, finish => 0 ); +klass ( 'PPIx::Regexp::Token::Delimiter' ); +content ( '/' ); +choose ( child => 1, child => 0 ); +klass ( 'PPIx::Regexp::Structure::Capture' ); +count ( 2 ); +raw_width( 2, 2 ); +width ( 0, 2 ); +choose ( child => 1, child => 0, start => [] ); +count ( 1 ); +choose ( child => 1, child => 0, start => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( '(' ); +choose ( child => 1, child => 0, type => [] ); +count ( 0 ); +choose ( child => 1, child => 0, finish => [] ); +count ( 1 ); +choose ( child => 1, child => 0, finish => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( ')' ); +choose ( child => 1, child => 0, child => 0 ); +klass ( 'PPIx::Regexp::Token::Literal' ); +content ( 'x' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 1, child => 0, child => 1 ); +klass ( 'PPIx::Regexp::Token::Literal' ); +content ( 'y' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 1, child => 1 ); +klass ( 'PPIx::Regexp::Token::Quantifier' ); +content ( '?' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); +choose ( child => 2 ); +klass ( 'PPIx::Regexp::Token::Modifier' ); +content ( '' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); + +parse ( '/(xy?)?/' ); +value ( failures => [], 0 ); +klass ( 'PPIx::Regexp' ); +count ( 3 ); +raw_width( 0, 2 ); +width ( 0, 2 ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +choose ( child => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( '' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); +choose ( child => 1 ); +klass ( 'PPIx::Regexp::Structure::Regexp' ); +count ( 2 ); +raw_width( 0, 2 ); +width ( 0, 2 ); +choose ( child => 1, start => [] ); +count ( 1 ); +choose ( child => 1, start => 0 ); +klass ( 'PPIx::Regexp::Token::Delimiter' ); +content ( '/' ); +choose ( child => 1, type => [] ); +count ( 0 ); +choose ( child => 1, finish => [] ); +count ( 1 ); +choose ( child => 1, finish => 0 ); +klass ( 'PPIx::Regexp::Token::Delimiter' ); +content ( '/' ); +choose ( child => 1, child => 0 ); +klass ( 'PPIx::Regexp::Structure::Capture' ); +count ( 3 ); +raw_width( 1, 2 ); +width ( 0, 2 ); +choose ( child => 1, child => 0, start => [] ); +count ( 1 ); +choose ( child => 1, child => 0, start => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( '(' ); +choose ( child => 1, child => 0, type => [] ); +count ( 0 ); +choose ( child => 1, child => 0, finish => [] ); +count ( 1 ); +choose ( child => 1, child => 0, finish => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( ')' ); +choose ( child => 1, child => 0, child => 0 ); +klass ( 'PPIx::Regexp::Token::Literal' ); +content ( 'x' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 1, child => 0, child => 1 ); +klass ( 'PPIx::Regexp::Token::Literal' ); +content ( 'y' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 1, 1 ); +width ( 0, 1 ); +choose ( child => 1, child => 0, child => 2 ); +klass ( 'PPIx::Regexp::Token::Quantifier' ); +content ( '?' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); +choose ( child => 1, child => 1 ); +klass ( 'PPIx::Regexp::Token::Quantifier' ); +content ( '?' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); +choose ( child => 2 ); +klass ( 'PPIx::Regexp::Token::Modifier' ); +content ( '' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); + +parse ( '/(xy?){,2}/' ); +value ( failures => [], 0 ); +klass ( 'PPIx::Regexp' ); +count ( 3 ); +raw_width( 0, 4 ); +width ( 0, 4 ); +value ( perl_version_introduced => [], '5.033006' ); +value ( perl_version_removed => [], undef ); +choose ( child => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( '' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); +choose ( child => 1 ); +klass ( 'PPIx::Regexp::Structure::Regexp' ); +count ( 2 ); +raw_width( 0, 4 ); +width ( 0, 4 ); +choose ( child => 1, start => [] ); +count ( 1 ); +choose ( child => 1, start => 0 ); +klass ( 'PPIx::Regexp::Token::Delimiter' ); +content ( '/' ); +choose ( child => 1, type => [] ); +count ( 0 ); +choose ( child => 1, finish => [] ); +count ( 1 ); +choose ( child => 1, finish => 0 ); +klass ( 'PPIx::Regexp::Token::Delimiter' ); +content ( '/' ); +choose ( child => 1, child => 0 ); +klass ( 'PPIx::Regexp::Structure::Capture' ); +count ( 3 ); +raw_width( 1, 2 ); +width ( 0, 4 ); +choose ( child => 1, child => 0, start => [] ); +count ( 1 ); +choose ( child => 1, child => 0, start => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( '(' ); +choose ( child => 1, child => 0, type => [] ); +count ( 0 ); +choose ( child => 1, child => 0, finish => [] ); +count ( 1 ); +choose ( child => 1, child => 0, finish => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( ')' ); +choose ( child => 1, child => 0, child => 0 ); +klass ( 'PPIx::Regexp::Token::Literal' ); +content ( 'x' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 1, child => 0, child => 1 ); +klass ( 'PPIx::Regexp::Token::Literal' ); +content ( 'y' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 1, 1 ); +width ( 0, 1 ); +choose ( child => 1, child => 0, child => 2 ); +klass ( 'PPIx::Regexp::Token::Quantifier' ); +content ( '?' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); +choose ( child => 1, child => 1 ); +klass ( 'PPIx::Regexp::Structure::Quantifier' ); +count ( 2 ); +raw_width( 2, 2 ); +width ( 0, 0 ); +choose ( child => 1, child => 1, start => [] ); +count ( 1 ); +choose ( child => 1, child => 1, start => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( '{' ); +choose ( child => 1, child => 1, type => [] ); +count ( 0 ); +choose ( child => 1, child => 1, finish => [] ); +count ( 1 ); +choose ( child => 1, child => 1, finish => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( '}' ); +choose ( child => 1, child => 1, child => 0 ); +klass ( 'PPIx::Regexp::Token::Literal' ); +content ( ',' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 1, child => 1, child => 1 ); +klass ( 'PPIx::Regexp::Token::Literal' ); +content ( 2 ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 2 ); +klass ( 'PPIx::Regexp::Token::Modifier' ); +content ( '' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); + +parse ( '/\\w+/' ); +value ( failures => [], 0 ); +klass ( 'PPIx::Regexp' ); +count ( 3 ); +raw_width( 1, INFINITY ); +width ( 1, INFINITY ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +choose ( child => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( '' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); +choose ( child => 1 ); +klass ( 'PPIx::Regexp::Structure::Regexp' ); +count ( 2 ); +raw_width( 1, INFINITY ); +width ( 1, INFINITY ); +choose ( child => 1, start => [] ); +count ( 1 ); +choose ( child => 1, start => 0 ); +klass ( 'PPIx::Regexp::Token::Delimiter' ); +content ( '/' ); +choose ( child => 1, type => [] ); +count ( 0 ); +choose ( child => 1, finish => [] ); +count ( 1 ); +choose ( child => 1, finish => 0 ); +klass ( 'PPIx::Regexp::Token::Delimiter' ); +content ( '/' ); +choose ( child => 1, child => 0 ); +klass ( 'PPIx::Regexp::Token::CharClass::Simple' ); +content ( '\\w' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 1, 1 ); +width ( 1, INFINITY ); +choose ( child => 1, child => 1 ); +klass ( 'PPIx::Regexp::Token::Quantifier' ); +content ( '+' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); +choose ( child => 2 ); +klass ( 'PPIx::Regexp::Token::Modifier' ); +content ( '' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); + +parse ( '/[xy]?/' ); +value ( failures => [], 0 ); +klass ( 'PPIx::Regexp' ); +count ( 3 ); +raw_width( 0, 1 ); +width ( 0, 1 ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +choose ( child => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( '' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); +choose ( child => 1 ); +klass ( 'PPIx::Regexp::Structure::Regexp' ); +count ( 2 ); +raw_width( 0, 1 ); +width ( 0, 1 ); +choose ( child => 1, start => [] ); +count ( 1 ); +choose ( child => 1, start => 0 ); +klass ( 'PPIx::Regexp::Token::Delimiter' ); +content ( '/' ); +choose ( child => 1, type => [] ); +count ( 0 ); +choose ( child => 1, finish => [] ); +count ( 1 ); +choose ( child => 1, finish => 0 ); +klass ( 'PPIx::Regexp::Token::Delimiter' ); +content ( '/' ); +choose ( child => 1, child => 0 ); +klass ( 'PPIx::Regexp::Structure::CharClass' ); +count ( 2 ); +raw_width( 1, 1 ); +width ( 0, 1 ); +choose ( child => 1, child => 0, start => [] ); +count ( 1 ); +choose ( child => 1, child => 0, start => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( '[' ); +choose ( child => 1, child => 0, type => [] ); +count ( 0 ); +choose ( child => 1, child => 0, finish => [] ); +count ( 1 ); +choose ( child => 1, child => 0, finish => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( ']' ); +choose ( child => 1, child => 0, child => 0 ); +klass ( 'PPIx::Regexp::Token::Literal' ); +content ( 'x' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 1, child => 0, child => 1 ); +klass ( 'PPIx::Regexp::Token::Literal' ); +content ( 'y' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 1, child => 1 ); +klass ( 'PPIx::Regexp::Token::Quantifier' ); +content ( '?' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); +choose ( child => 2 ); +klass ( 'PPIx::Regexp::Token::Modifier' ); +content ( '' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); + + +note 'Alternation'; + +parse ( '/x|yz/' ); +value ( failures => [], 0 ); +klass ( 'PPIx::Regexp' ); +count ( 3 ); +raw_width( 1, 2 ); +width ( 1, 2 ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +choose ( child => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( '' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); +choose ( child => 1 ); +klass ( 'PPIx::Regexp::Structure::Regexp' ); +count ( 4 ); +raw_width( 1, 2 ); +width ( 1, 2 ); +choose ( child => 1, start => [] ); +count ( 1 ); +choose ( child => 1, start => 0 ); +klass ( 'PPIx::Regexp::Token::Delimiter' ); +content ( '/' ); +choose ( child => 1, type => [] ); +count ( 0 ); +choose ( child => 1, finish => [] ); +count ( 1 ); +choose ( child => 1, finish => 0 ); +klass ( 'PPIx::Regexp::Token::Delimiter' ); +content ( '/' ); +choose ( child => 1, child => 0 ); +klass ( 'PPIx::Regexp::Token::Literal' ); +content ( 'x' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 1, child => 1 ); +klass ( 'PPIx::Regexp::Token::Operator' ); +content ( '|' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); +choose ( child => 1, child => 2 ); +klass ( 'PPIx::Regexp::Token::Literal' ); +content ( 'y' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 1, child => 3 ); +klass ( 'PPIx::Regexp::Token::Literal' ); +content ( 'z' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 2 ); +klass ( 'PPIx::Regexp::Token::Modifier' ); +content ( '' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); + + +note 'Interpolation'; + +parse ( '/$foo/' ); +value ( failures => [], 0 ); +klass ( 'PPIx::Regexp' ); +count ( 3 ); +raw_width( undef, undef ); +width ( undef, undef ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +choose ( child => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( '' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); +choose ( child => 1 ); +klass ( 'PPIx::Regexp::Structure::Regexp' ); +count ( 1 ); +raw_width( undef, undef ); +width ( undef, undef ); +choose ( child => 1, start => [] ); +count ( 1 ); +choose ( child => 1, start => 0 ); +klass ( 'PPIx::Regexp::Token::Delimiter' ); +content ( '/' ); +choose ( child => 1, type => [] ); +count ( 0 ); +choose ( child => 1, finish => [] ); +count ( 1 ); +choose ( child => 1, finish => 0 ); +klass ( 'PPIx::Regexp::Token::Delimiter' ); +content ( '/' ); +choose ( child => 1, child => 0 ); +klass ( 'PPIx::Regexp::Token::Interpolation' ); +content ( '$foo' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( undef, undef ); +choose ( child => 2 ); +klass ( 'PPIx::Regexp::Token::Modifier' ); +content ( '' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); + +parse ( '/a|$foo/' ); +value ( failures => [], 0 ); +klass ( 'PPIx::Regexp' ); +count ( 3 ); +raw_width( undef, undef ); +width ( undef, undef ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +choose ( child => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( '' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); +choose ( child => 1 ); +klass ( 'PPIx::Regexp::Structure::Regexp' ); +count ( 3 ); +raw_width( undef, undef ); +width ( undef, undef ); +choose ( child => 1, start => [] ); +count ( 1 ); +choose ( child => 1, start => 0 ); +klass ( 'PPIx::Regexp::Token::Delimiter' ); +content ( '/' ); +choose ( child => 1, type => [] ); +count ( 0 ); +choose ( child => 1, finish => [] ); +count ( 1 ); +choose ( child => 1, finish => 0 ); +klass ( 'PPIx::Regexp::Token::Delimiter' ); +content ( '/' ); +choose ( child => 1, child => 0 ); +klass ( 'PPIx::Regexp::Token::Literal' ); +content ( 'a' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 1, child => 1 ); +klass ( 'PPIx::Regexp::Token::Operator' ); +content ( '|' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); +choose ( child => 1, child => 2 ); +klass ( 'PPIx::Regexp::Token::Interpolation' ); +content ( '$foo' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( undef, undef ); +choose ( child => 2 ); +klass ( 'PPIx::Regexp::Token::Modifier' ); +content ( '' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); + +parse ( '/$foo|a/' ); +value ( failures => [], 0 ); +klass ( 'PPIx::Regexp' ); +count ( 3 ); +raw_width( undef, undef ); +width ( undef, undef ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +choose ( child => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( '' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); +choose ( child => 1 ); +klass ( 'PPIx::Regexp::Structure::Regexp' ); +count ( 3 ); +raw_width( undef, undef ); +width ( undef, undef ); +choose ( child => 1, start => [] ); +count ( 1 ); +choose ( child => 1, start => 0 ); +klass ( 'PPIx::Regexp::Token::Delimiter' ); +content ( '/' ); +choose ( child => 1, type => [] ); +count ( 0 ); +choose ( child => 1, finish => [] ); +count ( 1 ); +choose ( child => 1, finish => 0 ); +klass ( 'PPIx::Regexp::Token::Delimiter' ); +content ( '/' ); +choose ( child => 1, child => 0 ); +klass ( 'PPIx::Regexp::Token::Interpolation' ); +content ( '$foo' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( undef, undef ); +choose ( child => 1, child => 1 ); +klass ( 'PPIx::Regexp::Token::Operator' ); +content ( '|' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); +choose ( child => 1, child => 2 ); +klass ( 'PPIx::Regexp::Token::Literal' ); +content ( 'a' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 2 ); +klass ( 'PPIx::Regexp::Token::Modifier' ); +content ( '' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); + +parse ( '/x{2,$foo}/' ); +value ( failures => [], 0 ); +klass ( 'PPIx::Regexp' ); +count ( 3 ); +raw_width( 2, undef ); +width ( 2, undef ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +choose ( child => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( '' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); +choose ( child => 1 ); +klass ( 'PPIx::Regexp::Structure::Regexp' ); +count ( 2 ); +raw_width( 2, undef ); +width ( 2, undef ); +choose ( child => 1, start => [] ); +count ( 1 ); +choose ( child => 1, start => 0 ); +klass ( 'PPIx::Regexp::Token::Delimiter' ); +content ( '/' ); +choose ( child => 1, type => [] ); +count ( 0 ); +choose ( child => 1, finish => [] ); +count ( 1 ); +choose ( child => 1, finish => 0 ); +klass ( 'PPIx::Regexp::Token::Delimiter' ); +content ( '/' ); +choose ( child => 1, child => 0 ); +klass ( 'PPIx::Regexp::Token::Literal' ); +content ( 'x' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 1, 1 ); +width ( 2, undef ); +choose ( child => 1, child => 1 ); +klass ( 'PPIx::Regexp::Structure::Quantifier' ); +count ( 3 ); +raw_width( undef, undef ); +width ( 0, 0 ); +choose ( child => 1, child => 1, start => [] ); +count ( 1 ); +choose ( child => 1, child => 1, start => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( '{' ); +choose ( child => 1, child => 1, type => [] ); +count ( 0 ); +choose ( child => 1, child => 1, finish => [] ); +count ( 1 ); +choose ( child => 1, child => 1, finish => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( '}' ); +choose ( child => 1, child => 1, child => 0 ); +klass ( 'PPIx::Regexp::Token::Literal' ); +content ( 2 ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 1, child => 1, child => 1 ); +klass ( 'PPIx::Regexp::Token::Literal' ); +content ( ',' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 1, child => 1, child => 2 ); +klass ( 'PPIx::Regexp::Token::Interpolation' ); +content ( '$foo' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( undef, undef ); +choose ( child => 2 ); +klass ( 'PPIx::Regexp::Token::Modifier' ); +content ( '' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); + + +note 'Branch reset'; + +parse ( '/(?|(foo)|(bazzle))/' ); +value ( failures => [], 0 ); +klass ( 'PPIx::Regexp' ); +count ( 3 ); +raw_width( 3, 6 ); +width ( 3, 6 ); +value ( perl_version_introduced => [], '5.009005' ); +value ( perl_version_removed => [], undef ); +choose ( child => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( '' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); +choose ( child => 1 ); +klass ( 'PPIx::Regexp::Structure::Regexp' ); +count ( 1 ); +raw_width( 3, 6 ); +width ( 3, 6 ); +choose ( child => 1, start => [] ); +count ( 1 ); +choose ( child => 1, start => 0 ); +klass ( 'PPIx::Regexp::Token::Delimiter' ); +content ( '/' ); +choose ( child => 1, type => [] ); +count ( 0 ); +choose ( child => 1, finish => [] ); +count ( 1 ); +choose ( child => 1, finish => 0 ); +klass ( 'PPIx::Regexp::Token::Delimiter' ); +content ( '/' ); +choose ( child => 1, child => 0 ); +klass ( 'PPIx::Regexp::Structure::BranchReset' ); +count ( 3 ); +raw_width( 3, 6 ); +width ( 3, 6 ); +choose ( child => 1, child => 0, start => [] ); +count ( 1 ); +choose ( child => 1, child => 0, start => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( '(' ); +choose ( child => 1, child => 0, type => [] ); +count ( 1 ); +choose ( child => 1, child => 0, type => 0 ); +klass ( 'PPIx::Regexp::Token::GroupType::BranchReset' ); +content ( '?|' ); +choose ( child => 1, child => 0, finish => [] ); +count ( 1 ); +choose ( child => 1, child => 0, finish => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( ')' ); +choose ( child => 1, child => 0, child => 0 ); +klass ( 'PPIx::Regexp::Structure::Capture' ); +count ( 3 ); +raw_width( 3, 3 ); +width ( 3, 3 ); +choose ( child => 1, child => 0, child => 0, start => [] ); +count ( 1 ); +choose ( child => 1, child => 0, child => 0, start => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( '(' ); +choose ( child => 1, child => 0, child => 0, type => [] ); +count ( 0 ); +choose ( child => 1, child => 0, child => 0, finish => [] ); +count ( 1 ); +choose ( child => 1, child => 0, child => 0, finish => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( ')' ); +choose ( child => 1, child => 0, child => 0, child => 0 ); +klass ( 'PPIx::Regexp::Token::Literal' ); +content ( 'f' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 1, child => 0, child => 0, child => 1 ); +klass ( 'PPIx::Regexp::Token::Literal' ); +content ( 'o' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 1, child => 0, child => 0, child => 2 ); +klass ( 'PPIx::Regexp::Token::Literal' ); +content ( 'o' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 1, child => 0, child => 1 ); +klass ( 'PPIx::Regexp::Token::Operator' ); +content ( '|' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); +choose ( child => 1, child => 0, child => 2 ); +klass ( 'PPIx::Regexp::Structure::Capture' ); +count ( 6 ); +raw_width( 6, 6 ); +width ( 6, 6 ); +choose ( child => 1, child => 0, child => 2, start => [] ); +count ( 1 ); +choose ( child => 1, child => 0, child => 2, start => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( '(' ); +choose ( child => 1, child => 0, child => 2, type => [] ); +count ( 0 ); +choose ( child => 1, child => 0, child => 2, finish => [] ); +count ( 1 ); +choose ( child => 1, child => 0, child => 2, finish => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( ')' ); +choose ( child => 1, child => 0, child => 2, child => 0 ); +klass ( 'PPIx::Regexp::Token::Literal' ); +content ( 'b' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 1, child => 0, child => 2, child => 1 ); +klass ( 'PPIx::Regexp::Token::Literal' ); +content ( 'a' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 1, child => 0, child => 2, child => 2 ); +klass ( 'PPIx::Regexp::Token::Literal' ); +content ( 'z' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 1, child => 0, child => 2, child => 3 ); +klass ( 'PPIx::Regexp::Token::Literal' ); +content ( 'z' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 1, child => 0, child => 2, child => 4 ); +klass ( 'PPIx::Regexp::Token::Literal' ); +content ( 'l' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 1, child => 0, child => 2, child => 5 ); +klass ( 'PPIx::Regexp::Token::Literal' ); +content ( 'e' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 2 ); +klass ( 'PPIx::Regexp::Token::Modifier' ); +content ( '' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); + + +note 'Condition'; + +parse ( '/(x)(?(1)y|z)/' ); +value ( failures => [], 0 ); +klass ( 'PPIx::Regexp' ); +count ( 3 ); +raw_width( 2, 2 ); +width ( 2, 2 ); +value ( perl_version_introduced => [], '5.005' ); +value ( perl_version_removed => [], undef ); +choose ( child => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( '' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); +choose ( child => 1 ); +klass ( 'PPIx::Regexp::Structure::Regexp' ); +count ( 2 ); +raw_width( 2, 2 ); +width ( 2, 2 ); +choose ( child => 1, start => [] ); +count ( 1 ); +choose ( child => 1, start => 0 ); +klass ( 'PPIx::Regexp::Token::Delimiter' ); +content ( '/' ); +choose ( child => 1, type => [] ); +count ( 0 ); +choose ( child => 1, finish => [] ); +count ( 1 ); +choose ( child => 1, finish => 0 ); +klass ( 'PPIx::Regexp::Token::Delimiter' ); +content ( '/' ); +choose ( child => 1, child => 0 ); +klass ( 'PPIx::Regexp::Structure::Capture' ); +count ( 1 ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 1, child => 0, start => [] ); +count ( 1 ); +choose ( child => 1, child => 0, start => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( '(' ); +choose ( child => 1, child => 0, type => [] ); +count ( 0 ); +choose ( child => 1, child => 0, finish => [] ); +count ( 1 ); +choose ( child => 1, child => 0, finish => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( ')' ); +choose ( child => 1, child => 0, child => 0 ); +klass ( 'PPIx::Regexp::Token::Literal' ); +content ( 'x' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 1, child => 1 ); +klass ( 'PPIx::Regexp::Structure::Switch' ); +count ( 4 ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 1, child => 1, start => [] ); +count ( 1 ); +choose ( child => 1, child => 1, start => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( '(' ); +choose ( child => 1, child => 1, type => [] ); +count ( 1 ); +choose ( child => 1, child => 1, type => 0 ); +klass ( 'PPIx::Regexp::Token::GroupType::Switch' ); +content ( '?' ); +choose ( child => 1, child => 1, finish => [] ); +count ( 1 ); +choose ( child => 1, child => 1, finish => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( ')' ); +choose ( child => 1, child => 1, child => 0 ); +klass ( 'PPIx::Regexp::Token::Condition' ); +content ( '(1)' ); +value ( perl_version_introduced => [], '5.005' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); +choose ( child => 1, child => 1, child => 1 ); +klass ( 'PPIx::Regexp::Token::Literal' ); +content ( 'y' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 1, child => 1, child => 2 ); +klass ( 'PPIx::Regexp::Token::Operator' ); +content ( '|' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); +choose ( child => 1, child => 1, child => 3 ); +klass ( 'PPIx::Regexp::Token::Literal' ); +content ( 'z' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 2 ); +klass ( 'PPIx::Regexp::Token::Modifier' ); +content ( '' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); + +parse ( '/(x)(?(1)y)/' ); +value ( failures => [], 0 ); +klass ( 'PPIx::Regexp' ); +count ( 3 ); +raw_width( 1, 2 ); +width ( 1, 2 ); +value ( perl_version_introduced => [], '5.005' ); +value ( perl_version_removed => [], undef ); +choose ( child => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( '' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); +choose ( child => 1 ); +klass ( 'PPIx::Regexp::Structure::Regexp' ); +count ( 2 ); +raw_width( 1, 2 ); +width ( 1, 2 ); +choose ( child => 1, start => [] ); +count ( 1 ); +choose ( child => 1, start => 0 ); +klass ( 'PPIx::Regexp::Token::Delimiter' ); +content ( '/' ); +choose ( child => 1, type => [] ); +count ( 0 ); +choose ( child => 1, finish => [] ); +count ( 1 ); +choose ( child => 1, finish => 0 ); +klass ( 'PPIx::Regexp::Token::Delimiter' ); +content ( '/' ); +choose ( child => 1, child => 0 ); +klass ( 'PPIx::Regexp::Structure::Capture' ); +count ( 1 ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 1, child => 0, start => [] ); +count ( 1 ); +choose ( child => 1, child => 0, start => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( '(' ); +choose ( child => 1, child => 0, type => [] ); +count ( 0 ); +choose ( child => 1, child => 0, finish => [] ); +count ( 1 ); +choose ( child => 1, child => 0, finish => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( ')' ); +choose ( child => 1, child => 0, child => 0 ); +klass ( 'PPIx::Regexp::Token::Literal' ); +content ( 'x' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 1, child => 1 ); +klass ( 'PPIx::Regexp::Structure::Switch' ); +count ( 2 ); +raw_width( 0, 1 ); +width ( 0, 1 ); +choose ( child => 1, child => 1, start => [] ); +count ( 1 ); +choose ( child => 1, child => 1, start => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( '(' ); +choose ( child => 1, child => 1, type => [] ); +count ( 1 ); +choose ( child => 1, child => 1, type => 0 ); +klass ( 'PPIx::Regexp::Token::GroupType::Switch' ); +content ( '?' ); +choose ( child => 1, child => 1, finish => [] ); +count ( 1 ); +choose ( child => 1, child => 1, finish => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( ')' ); +choose ( child => 1, child => 1, child => 0 ); +klass ( 'PPIx::Regexp::Token::Condition' ); +content ( '(1)' ); +value ( perl_version_introduced => [], '5.005' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); +choose ( child => 1, child => 1, child => 1 ); +klass ( 'PPIx::Regexp::Token::Literal' ); +content ( 'y' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 2 ); +klass ( 'PPIx::Regexp::Token::Modifier' ); +content ( '' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); + +parse ( '/(?(DEFINE)(?fubar))/' ); +value ( failures => [], 0 ); +klass ( 'PPIx::Regexp' ); +count ( 3 ); +raw_width( 0, 0 ); +width ( 0, 0 ); +value ( perl_version_introduced => [], '5.009005' ); +value ( perl_version_removed => [], undef ); +choose ( child => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( '' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); +choose ( child => 1 ); +klass ( 'PPIx::Regexp::Structure::Regexp' ); +count ( 1 ); +raw_width( 0, 0 ); +width ( 0, 0 ); +choose ( child => 1, start => [] ); +count ( 1 ); +choose ( child => 1, start => 0 ); +klass ( 'PPIx::Regexp::Token::Delimiter' ); +content ( '/' ); +choose ( child => 1, type => [] ); +count ( 0 ); +choose ( child => 1, finish => [] ); +count ( 1 ); +choose ( child => 1, finish => 0 ); +klass ( 'PPIx::Regexp::Token::Delimiter' ); +content ( '/' ); +choose ( child => 1, child => 0 ); +klass ( 'PPIx::Regexp::Structure::Switch' ); +count ( 2 ); +raw_width( 0, 0 ); +width ( 0, 0 ); +choose ( child => 1, child => 0, start => [] ); +count ( 1 ); +choose ( child => 1, child => 0, start => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( '(' ); +choose ( child => 1, child => 0, type => [] ); +count ( 1 ); +choose ( child => 1, child => 0, type => 0 ); +klass ( 'PPIx::Regexp::Token::GroupType::Switch' ); +content ( '?' ); +choose ( child => 1, child => 0, finish => [] ); +count ( 1 ); +choose ( child => 1, child => 0, finish => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( ')' ); +choose ( child => 1, child => 0, child => 0 ); +klass ( 'PPIx::Regexp::Token::Condition' ); +content ( '(DEFINE)' ); +value ( perl_version_introduced => [], '5.009005' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); +choose ( child => 1, child => 0, child => 1 ); +klass ( 'PPIx::Regexp::Structure::NamedCapture' ); +count ( 5 ); +raw_width( 5, 5 ); +width ( 5, 5 ); +choose ( child => 1, child => 0, child => 1, start => [] ); +count ( 1 ); +choose ( child => 1, child => 0, child => 1, start => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( '(' ); +choose ( child => 1, child => 0, child => 1, type => [] ); +count ( 1 ); +choose ( child => 1, child => 0, child => 1, type => 0 ); +klass ( 'PPIx::Regexp::Token::GroupType::NamedCapture' ); +content ( '?' ); +choose ( child => 1, child => 0, child => 1, finish => [] ); +count ( 1 ); +choose ( child => 1, child => 0, child => 1, finish => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( ')' ); +choose ( child => 1, child => 0, child => 1, child => 0 ); +klass ( 'PPIx::Regexp::Token::Literal' ); +content ( 'f' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 1, child => 0, child => 1, child => 1 ); +klass ( 'PPIx::Regexp::Token::Literal' ); +content ( 'u' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 1, child => 0, child => 1, child => 2 ); +klass ( 'PPIx::Regexp::Token::Literal' ); +content ( 'b' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 1, child => 0, child => 1, child => 3 ); +klass ( 'PPIx::Regexp::Token::Literal' ); +content ( 'a' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 1, child => 0, child => 1, child => 4 ); +klass ( 'PPIx::Regexp::Token::Literal' ); +content ( 'r' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 2 ); +klass ( 'PPIx::Regexp::Token::Modifier' ); +content ( '' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); + + +note 'Look-around assertion'; + +parse ( '/(?=foo)/' ); +value ( failures => [], 0 ); +klass ( 'PPIx::Regexp' ); +count ( 3 ); +raw_width( 0, 0 ); +width ( 0, 0 ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +choose ( child => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( '' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); +choose ( child => 1 ); +klass ( 'PPIx::Regexp::Structure::Regexp' ); +count ( 1 ); +raw_width( 0, 0 ); +width ( 0, 0 ); +choose ( child => 1, start => [] ); +count ( 1 ); +choose ( child => 1, start => 0 ); +klass ( 'PPIx::Regexp::Token::Delimiter' ); +content ( '/' ); +choose ( child => 1, type => [] ); +count ( 0 ); +choose ( child => 1, finish => [] ); +count ( 1 ); +choose ( child => 1, finish => 0 ); +klass ( 'PPIx::Regexp::Token::Delimiter' ); +content ( '/' ); +choose ( child => 1, child => 0 ); +klass ( 'PPIx::Regexp::Structure::Assertion' ); +count ( 3 ); +raw_width( 3, 3 ); +width ( 0, 0 ); +choose ( child => 1, child => 0, start => [] ); +count ( 1 ); +choose ( child => 1, child => 0, start => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( '(' ); +choose ( child => 1, child => 0, type => [] ); +count ( 1 ); +choose ( child => 1, child => 0, type => 0 ); +klass ( 'PPIx::Regexp::Token::GroupType::Assertion' ); +content ( '?=' ); +choose ( child => 1, child => 0, finish => [] ); +count ( 1 ); +choose ( child => 1, child => 0, finish => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( ')' ); +choose ( child => 1, child => 0, child => 0 ); +klass ( 'PPIx::Regexp::Token::Literal' ); +content ( 'f' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 1, child => 0, child => 1 ); +klass ( 'PPIx::Regexp::Token::Literal' ); +content ( 'o' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 1, child => 0, child => 2 ); +klass ( 'PPIx::Regexp::Token::Literal' ); +content ( 'o' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 2 ); +klass ( 'PPIx::Regexp::Token::Modifier' ); +content ( '' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); + + +note 'Back reference'; + +parse ( '/(x)\\1)/' ); +value ( failures => [], 1 ); +klass ( 'PPIx::Regexp' ); +count ( 3 ); +raw_width( 2, 2 ); +width ( 2, 2 ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +choose ( child => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( '' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); +choose ( child => 1 ); +klass ( 'PPIx::Regexp::Structure::Regexp' ); +count ( 3 ); +raw_width( 2, 2 ); +width ( 2, 2 ); +choose ( child => 1, start => [] ); +count ( 1 ); +choose ( child => 1, start => 0 ); +klass ( 'PPIx::Regexp::Token::Delimiter' ); +content ( '/' ); +choose ( child => 1, type => [] ); +count ( 0 ); +choose ( child => 1, finish => [] ); +count ( 1 ); +choose ( child => 1, finish => 0 ); +klass ( 'PPIx::Regexp::Token::Delimiter' ); +content ( '/' ); +choose ( child => 1, child => 0 ); +klass ( 'PPIx::Regexp::Structure::Capture' ); +count ( 1 ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 1, child => 0, start => [] ); +count ( 1 ); +choose ( child => 1, child => 0, start => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( '(' ); +choose ( child => 1, child => 0, type => [] ); +count ( 0 ); +choose ( child => 1, child => 0, finish => [] ); +count ( 1 ); +choose ( child => 1, child => 0, finish => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( ')' ); +choose ( child => 1, child => 0, child => 0 ); +klass ( 'PPIx::Regexp::Token::Literal' ); +content ( 'x' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 1, child => 1 ); +klass ( 'PPIx::Regexp::Token::Backreference' ); +content ( '\\1' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 1, child => 2 ); +klass ( 'PPIx::Regexp::Token::Unmatched' ); +content ( ')' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); +choose ( child => 2 ); +klass ( 'PPIx::Regexp::Token::Modifier' ); +content ( '' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); + +parse ( '/(x)\\g{-1})/' ); +value ( failures => [], 1 ); +klass ( 'PPIx::Regexp' ); +count ( 3 ); +raw_width( 2, 2 ); +width ( 2, 2 ); +value ( perl_version_introduced => [], '5.009005' ); +value ( perl_version_removed => [], undef ); +choose ( child => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( '' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); +choose ( child => 1 ); +klass ( 'PPIx::Regexp::Structure::Regexp' ); +count ( 3 ); +raw_width( 2, 2 ); +width ( 2, 2 ); +choose ( child => 1, start => [] ); +count ( 1 ); +choose ( child => 1, start => 0 ); +klass ( 'PPIx::Regexp::Token::Delimiter' ); +content ( '/' ); +choose ( child => 1, type => [] ); +count ( 0 ); +choose ( child => 1, finish => [] ); +count ( 1 ); +choose ( child => 1, finish => 0 ); +klass ( 'PPIx::Regexp::Token::Delimiter' ); +content ( '/' ); +choose ( child => 1, child => 0 ); +klass ( 'PPIx::Regexp::Structure::Capture' ); +count ( 1 ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 1, child => 0, start => [] ); +count ( 1 ); +choose ( child => 1, child => 0, start => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( '(' ); +choose ( child => 1, child => 0, type => [] ); +count ( 0 ); +choose ( child => 1, child => 0, finish => [] ); +count ( 1 ); +choose ( child => 1, child => 0, finish => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( ')' ); +choose ( child => 1, child => 0, child => 0 ); +klass ( 'PPIx::Regexp::Token::Literal' ); +content ( 'x' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 1, child => 1 ); +klass ( 'PPIx::Regexp::Token::Backreference' ); +content ( '\\g{-1}' ); +value ( perl_version_introduced => [], '5.009005' ); +value ( perl_version_removed => [], undef ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 1, child => 2 ); +klass ( 'PPIx::Regexp::Token::Unmatched' ); +content ( ')' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); +choose ( child => 2 ); +klass ( 'PPIx::Regexp::Token::Modifier' ); +content ( '' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); + +parse ( '/(?|(x)|(y))\\1/' ); +value ( failures => [], 0 ); +klass ( 'PPIx::Regexp' ); +count ( 3 ); +raw_width( 2, 2 ); +width ( 2, 2 ); +value ( perl_version_introduced => [], '5.009005' ); +value ( perl_version_removed => [], undef ); +choose ( child => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( '' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); +choose ( child => 1 ); +klass ( 'PPIx::Regexp::Structure::Regexp' ); +count ( 2 ); +raw_width( 2, 2 ); +width ( 2, 2 ); +choose ( child => 1, start => [] ); +count ( 1 ); +choose ( child => 1, start => 0 ); +klass ( 'PPIx::Regexp::Token::Delimiter' ); +content ( '/' ); +choose ( child => 1, type => [] ); +count ( 0 ); +choose ( child => 1, finish => [] ); +count ( 1 ); +choose ( child => 1, finish => 0 ); +klass ( 'PPIx::Regexp::Token::Delimiter' ); +content ( '/' ); +choose ( child => 1, child => 0 ); +klass ( 'PPIx::Regexp::Structure::BranchReset' ); +count ( 3 ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 1, child => 0, start => [] ); +count ( 1 ); +choose ( child => 1, child => 0, start => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( '(' ); +choose ( child => 1, child => 0, type => [] ); +count ( 1 ); +choose ( child => 1, child => 0, type => 0 ); +klass ( 'PPIx::Regexp::Token::GroupType::BranchReset' ); +content ( '?|' ); +choose ( child => 1, child => 0, finish => [] ); +count ( 1 ); +choose ( child => 1, child => 0, finish => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( ')' ); +choose ( child => 1, child => 0, child => 0 ); +klass ( 'PPIx::Regexp::Structure::Capture' ); +count ( 1 ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 1, child => 0, child => 0, start => [] ); +count ( 1 ); +choose ( child => 1, child => 0, child => 0, start => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( '(' ); +choose ( child => 1, child => 0, child => 0, type => [] ); +count ( 0 ); +choose ( child => 1, child => 0, child => 0, finish => [] ); +count ( 1 ); +choose ( child => 1, child => 0, child => 0, finish => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( ')' ); +choose ( child => 1, child => 0, child => 0, child => 0 ); +klass ( 'PPIx::Regexp::Token::Literal' ); +content ( 'x' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 1, child => 0, child => 1 ); +klass ( 'PPIx::Regexp::Token::Operator' ); +content ( '|' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); +choose ( child => 1, child => 0, child => 2 ); +klass ( 'PPIx::Regexp::Structure::Capture' ); +count ( 1 ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 1, child => 0, child => 2, start => [] ); +count ( 1 ); +choose ( child => 1, child => 0, child => 2, start => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( '(' ); +choose ( child => 1, child => 0, child => 2, type => [] ); +count ( 0 ); +choose ( child => 1, child => 0, child => 2, finish => [] ); +count ( 1 ); +choose ( child => 1, child => 0, child => 2, finish => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( ')' ); +choose ( child => 1, child => 0, child => 2, child => 0 ); +klass ( 'PPIx::Regexp::Token::Literal' ); +content ( 'y' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 1, child => 1 ); +klass ( 'PPIx::Regexp::Token::Backreference' ); +content ( '\\1' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 2 ); +klass ( 'PPIx::Regexp::Token::Modifier' ); +content ( '' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); + +parse ( '/(?|(x)|(yz))\\1/' ); +value ( failures => [], 0 ); +klass ( 'PPIx::Regexp' ); +count ( 3 ); +raw_width( undef, undef ); +width ( undef, undef ); +value ( perl_version_introduced => [], '5.009005' ); +value ( perl_version_removed => [], undef ); +choose ( child => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( '' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); +choose ( child => 1 ); +klass ( 'PPIx::Regexp::Structure::Regexp' ); +count ( 2 ); +raw_width( undef, undef ); +width ( undef, undef ); +choose ( child => 1, start => [] ); +count ( 1 ); +choose ( child => 1, start => 0 ); +klass ( 'PPIx::Regexp::Token::Delimiter' ); +content ( '/' ); +choose ( child => 1, type => [] ); +count ( 0 ); +choose ( child => 1, finish => [] ); +count ( 1 ); +choose ( child => 1, finish => 0 ); +klass ( 'PPIx::Regexp::Token::Delimiter' ); +content ( '/' ); +choose ( child => 1, child => 0 ); +klass ( 'PPIx::Regexp::Structure::BranchReset' ); +count ( 3 ); +raw_width( 1, 2 ); +width ( 1, 2 ); +choose ( child => 1, child => 0, start => [] ); +count ( 1 ); +choose ( child => 1, child => 0, start => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( '(' ); +choose ( child => 1, child => 0, type => [] ); +count ( 1 ); +choose ( child => 1, child => 0, type => 0 ); +klass ( 'PPIx::Regexp::Token::GroupType::BranchReset' ); +content ( '?|' ); +choose ( child => 1, child => 0, finish => [] ); +count ( 1 ); +choose ( child => 1, child => 0, finish => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( ')' ); +choose ( child => 1, child => 0, child => 0 ); +klass ( 'PPIx::Regexp::Structure::Capture' ); +count ( 1 ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 1, child => 0, child => 0, start => [] ); +count ( 1 ); +choose ( child => 1, child => 0, child => 0, start => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( '(' ); +choose ( child => 1, child => 0, child => 0, type => [] ); +count ( 0 ); +choose ( child => 1, child => 0, child => 0, finish => [] ); +count ( 1 ); +choose ( child => 1, child => 0, child => 0, finish => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( ')' ); +choose ( child => 1, child => 0, child => 0, child => 0 ); +klass ( 'PPIx::Regexp::Token::Literal' ); +content ( 'x' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 1, child => 0, child => 1 ); +klass ( 'PPIx::Regexp::Token::Operator' ); +content ( '|' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); +choose ( child => 1, child => 0, child => 2 ); +klass ( 'PPIx::Regexp::Structure::Capture' ); +count ( 2 ); +raw_width( 2, 2 ); +width ( 2, 2 ); +choose ( child => 1, child => 0, child => 2, start => [] ); +count ( 1 ); +choose ( child => 1, child => 0, child => 2, start => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( '(' ); +choose ( child => 1, child => 0, child => 2, type => [] ); +count ( 0 ); +choose ( child => 1, child => 0, child => 2, finish => [] ); +count ( 1 ); +choose ( child => 1, child => 0, child => 2, finish => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( ')' ); +choose ( child => 1, child => 0, child => 2, child => 0 ); +klass ( 'PPIx::Regexp::Token::Literal' ); +content ( 'y' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 1, child => 0, child => 2, child => 1 ); +klass ( 'PPIx::Regexp::Token::Literal' ); +content ( 'z' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 1, child => 1 ); +klass ( 'PPIx::Regexp::Token::Backreference' ); +content ( '\\1' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( undef, undef ); +width ( undef, undef ); +choose ( child => 2 ); +klass ( 'PPIx::Regexp::Token::Modifier' ); +content ( '' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); + +parse ( '/(?y)\\g{x}/' ); +value ( failures => [], 0 ); +klass ( 'PPIx::Regexp' ); +count ( 3 ); +raw_width( 2, 2 ); +width ( 2, 2 ); +value ( perl_version_introduced => [], '5.009005' ); +value ( perl_version_removed => [], undef ); +choose ( child => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( '' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); +choose ( child => 1 ); +klass ( 'PPIx::Regexp::Structure::Regexp' ); +count ( 2 ); +raw_width( 2, 2 ); +width ( 2, 2 ); +choose ( child => 1, start => [] ); +count ( 1 ); +choose ( child => 1, start => 0 ); +klass ( 'PPIx::Regexp::Token::Delimiter' ); +content ( '/' ); +choose ( child => 1, type => [] ); +count ( 0 ); +choose ( child => 1, finish => [] ); +count ( 1 ); +choose ( child => 1, finish => 0 ); +klass ( 'PPIx::Regexp::Token::Delimiter' ); +content ( '/' ); +choose ( child => 1, child => 0 ); +klass ( 'PPIx::Regexp::Structure::NamedCapture' ); +count ( 1 ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 1, child => 0, start => [] ); +count ( 1 ); +choose ( child => 1, child => 0, start => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( '(' ); +choose ( child => 1, child => 0, type => [] ); +count ( 1 ); +choose ( child => 1, child => 0, type => 0 ); +klass ( 'PPIx::Regexp::Token::GroupType::NamedCapture' ); +content ( '?' ); +choose ( child => 1, child => 0, finish => [] ); +count ( 1 ); +choose ( child => 1, child => 0, finish => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( ')' ); +choose ( child => 1, child => 0, child => 0 ); +klass ( 'PPIx::Regexp::Token::Literal' ); +content ( 'y' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 1, child => 1 ); +klass ( 'PPIx::Regexp::Token::Backreference' ); +content ( '\\g{x}' ); +value ( perl_version_introduced => [], '5.009005' ); +value ( perl_version_removed => [], undef ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 2 ); +klass ( 'PPIx::Regexp::Token::Modifier' ); +content ( '' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); + + +note 'Recursion'; + +parse ( '/x(?R)/' ); +value ( failures => [], 0 ); +klass ( 'PPIx::Regexp' ); +count ( 3 ); +raw_width( undef, undef ); +width ( undef, undef ); +value ( perl_version_introduced => [], '5.009005' ); +value ( perl_version_removed => [], undef ); +choose ( child => 0 ); +klass ( 'PPIx::Regexp::Token::Structure' ); +content ( '' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); +choose ( child => 1 ); +klass ( 'PPIx::Regexp::Structure::Regexp' ); +count ( 2 ); +raw_width( undef, undef ); +width ( undef, undef ); +choose ( child => 1, start => [] ); +count ( 1 ); +choose ( child => 1, start => 0 ); +klass ( 'PPIx::Regexp::Token::Delimiter' ); +content ( '/' ); +choose ( child => 1, type => [] ); +count ( 0 ); +choose ( child => 1, finish => [] ); +count ( 1 ); +choose ( child => 1, finish => 0 ); +klass ( 'PPIx::Regexp::Token::Delimiter' ); +content ( '/' ); +choose ( child => 1, child => 0 ); +klass ( 'PPIx::Regexp::Token::Literal' ); +content ( 'x' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 1, 1 ); +width ( 1, 1 ); +choose ( child => 1, child => 1 ); +klass ( 'PPIx::Regexp::Token::Recursion' ); +content ( '(?R)' ); +value ( perl_version_introduced => [], '5.009005' ); +value ( perl_version_removed => [], undef ); +raw_width( undef, undef ); +width ( undef, undef ); +choose ( child => 2 ); +klass ( 'PPIx::Regexp::Token::Modifier' ); +content ( '' ); +value ( perl_version_introduced => [], '5.000' ); +value ( perl_version_removed => [], undef ); +raw_width( 0, 0 ); +width ( 0, 0 ); + +# TODO: references +# PPIx::Regexp::Token::Reference +# This is actually an abstract class with a number of subclasses: +# PPIx::Regexp::Token::Backreference +# This is the \1 (absolute) and \g{-1} (relative) thingy. If I can +# match them to their capture groups I'm set, because they match +# whatever the capture group does. +# I think the logic here is to take the unit_width of the corresponding +# capture if it can be identified uniquely. This may fail in the +# presence of branch resets (numeric back references) or multiple +# definintions (named back references). +# PPIx::Regexp::Token::Condition +# The unit_width() is zero because the condition does not match +# anything, it just determines whether a match occurred. +# unit_raw_width() will be the same as for ::Backreference +# PPIx::Regexp::Token::Regression (DONE) +# Indeterminate by static analysis. +# It might make this job much easier if I could track capture numbers +# and names as they are created. This doesn't work for regressions, +# but I'm not targeting them anyway at this point. + +done_testing; + +1; + +# ex: set textwidth=72 : diff -Nru libppix-regexp-perl-0.085/xt/author/pod_spelling.t libppix-regexp-perl-0.086/xt/author/pod_spelling.t --- libppix-regexp-perl-0.085/xt/author/pod_spelling.t 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/xt/author/pod_spelling.t 2022-12-13 14:26:59.000000000 +0000 @@ -37,6 +37,7 @@ merchantability nav navigational +numification perlrecharclass perluniprops POSIX @@ -67,7 +68,7 @@ trigraphs Un unicode -unforseen +unquantified unterminated UTF version's diff -Nru libppix-regexp-perl-0.085/xt/author/unit_left_curly.t libppix-regexp-perl-0.086/xt/author/unit_left_curly.t --- libppix-regexp-perl-0.085/xt/author/unit_left_curly.t 2022-04-16 15:00:28.000000000 +0000 +++ libppix-regexp-perl-0.086/xt/author/unit_left_curly.t 2022-12-13 14:26:59.000000000 +0000 @@ -7,6 +7,11 @@ use Test::More 0.88; # Because of done_testing(); +BEGIN { + "$]" >= 5.016 + or plan skip_all => 'Dodgy test requires at least Perl 5.16'; +} + # Mung with manifest constants, since at the time this was written they # were undefined. @@ -23,6 +28,7 @@ { no warnings qw{ redefine }; + no warnings; # These get hammered over what was loaded above. At least under # 5.26.1, we do NOT want an explicit return(), because it seems to