Permalink
Browse files

Implement "spaces bordering **" rule

  • Loading branch information...
1 parent fa199e9 commit 9c59f52762ad3e3446493a9e41b3679da9d5849e @sorear committed Jun 24, 2011
Showing with 11 additions and 0 deletions.
  1. +10 −0 src/niecza
  2. +1 −0 t/spectest.data
View
@@ -47,6 +47,16 @@ method quantified_atom($/) { # :: RxOp
if defined $q<min> {
my @z = $atom;
push @z, $q<sep> if defined $q<sep>;
+ # parsing quirk, x #`(1) ** #`(2) y, the 1* position is counted
+ # as $<normspace> but the 2* is parsed by the quantifier
+ if $q<general> && %*RX<s> && ($q<space> || $<normspace>) {
+ if @z[1] {
+ @z[1] = ::RxOp::Sequence.new(zyg => [
+ ::RxOp::Sigspace.new, @z[1], ::RxOp::Sigspace.new]);
+ } else {
+ push @z, ::RxOp::Sigspace.new;
+ }
+ }
$atom = ::RxOp::Quantifier.new(min => $q<min>, max => $q<max>,
nonlisty => $q<nonlisty>, closure => $q<closure>,
zyg => [@z], minimal => ($q<mod> && $q<mod> eq '?'));
View
@@ -75,6 +75,7 @@ S05-mass/recursive.t
S05-metachars/line-anchors.t
S05-metasyntax/changed.t
S05-metasyntax/null.t
+S05-metasyntax/repeat.t
S05-metasyntax/single-quotes.t
S06-multi/lexical-multis.t
S06-advanced_subroutine_features/caller.t

0 comments on commit 9c59f52

Please sign in to comment.