Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix Match.perl after then $0 change
  • Loading branch information
sorear committed Jul 7, 2011
1 parent 0b2219d commit 739ab2f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/CORE.setting
Expand Up @@ -1320,8 +1320,11 @@ my class Match is Cool {
method ast () { Q:CgOp { (ns (cursor_ast (cast cursor (@ {self})))) } }
method chars() { defined(self) ?? $.to - $.from !! 0 }
method perl() {
!defined(self) ?? self.typename !!
"#<match from({ self.from }) to({ self.to }) text({ self }) pos({ @(self).perl }) named({ %(self).perl })>"
self // nextsame;
my @pos = @(self);
@pos = () if @pos == 1 && @pos[0] === self;
"#<match from({ self.from }) to({ self.to }) text({ self }) pos({ @pos.perl }) named({ %(self).perl })>"
}
method CURSOR() { Q:CgOp { (ns (cursor_unmatch (cast cursor (@ {self})))) } }
method cursor() { Q:CgOp { (ns (cursor_unmatch (cast cursor (@ {self})))) } }
Expand Down

0 comments on commit 739ab2f

Please sign in to comment.