Skip to content

Commit

Permalink
initial Match.new - does not handle subcaptures yet
Browse files Browse the repository at this point in the history
  • Loading branch information
moritz committed Jul 12, 2010
1 parent 129c37f commit 94d01ff
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/core/Match.pm
@@ -1,4 +1,15 @@
class Match is Regex::Match is Cool does Positional does Associative {
method create(:$from, :$to, :$orig) {
my $new = self.bless(*);
pir::setattribute__vpsp($new, '$!from', $from);
pir::setattribute__vpsp($new, '$!to', $to);
pir::setattribute__vpsp($new, '$!target', $orig);

# TODO: handle :@positional, :%named

$new;
}

method ast() {
my $x = self.Regex::Match::ast;
pir::isa__IPs($x, 'Undef') ?? Any !! $x;
Expand Down

0 comments on commit 94d01ff

Please sign in to comment.