Skip to content

Commit

Permalink
enable m//, though without adverb checking and runtime adverbs
Browse files Browse the repository at this point in the history
  • Loading branch information
moritz committed Jul 24, 2011
1 parent 44c8eeb commit c15a26e
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/Perl6/Actions.pm
Expand Up @@ -2945,24 +2945,20 @@ class Perl6::Actions is HLL::Actions {
make block_closure($coderef);
}
method quote:sym<m>($/) {
$regex := Regex::P6Regex::Actions::buildsub($<p6regex>.ast);
my $regex := block_closure($regex, 'Regex', 0);
my $block := PAST::Block.new(PAST::Stmts.new, PAST::Stmts.new, :node($/));
my $coderef := regex_coderef($/, $<p6regex>.ast, 'anon', '', [], $block);

my $past := PAST::Op.new(
:node($/),
:pasttype('callmethod'), :name('match'),
PAST::Var.new( :name('$_'), :scope('lexical_6model') ),
$regex
block_closure($coderef)
);
self.handle_and_check_adverbs($/, %MATCH_ALLOWED_ADVERBS, 'm', $past);
$past := PAST::Op.new(
:node($/),
:pasttype('call'), :name('&infix:<:=>'),
# self.handle_and_check_adverbs($/, %MATCH_ALLOWED_ADVERBS, 'm', $past);
make PAST::Op.new( :pasttype('bind_6model'),
PAST::Var.new(:name('$/'), :scope('lexical_6model')),
$past
);

make $past;
}

method handle_and_check_adverbs($/, %adverbs, $what, $past?) {
Expand Down

0 comments on commit c15a26e

Please sign in to comment.