Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixes to compiler to work with correct $/ semantic
  • Loading branch information
sorear committed Jul 9, 2011
1 parent 8dc8c8f commit d3c5fc0
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/NieczaActions.pm6
Expand Up @@ -280,9 +280,11 @@ method op_for_regex($/, $rxop) {
$rxop.check
}
my ($orxop, $mb) = ::GLOBAL::OptRxSimple.run($rxop);
self.block_expr($/, self.thunk_sub(::Op::RegexBody.new(|node($/),
my $sub = self.thunk_sub(::Op::RegexBody.new(|node($/),
canback => $mb, pre => @lift, rxop => $orxop),
class => 'Regex', params => ['self']));
class => 'Regex', params => ['self']);
$sub.add_my_name('$/');
self.block_expr($/, $sub);
}

method quote:sym</ /> ($/) { make self.op_for_regex($/, $<nibble>.ast) }
Expand Down Expand Up @@ -1217,20 +1219,20 @@ method CHAIN($/) {

my ($st, @vargs) = self.whatever_precheck(@ops[0], @args);

sub reduce() {
sub reduce($/) {
my $fa = shift @vargs;
my $fo = shift @ops;
if @ops {
mklet($fa, -> $lhs { mklet(@vargs[0], -> $rhs {
@vargs[0] = $rhs;
::Op::ShortCircuit.new(|node($/), kind => '&&', args =>
[ $fo.with_args($/, $lhs, $rhs), reduce() ]) }) })
[ $fo.with_args($/, $lhs, $rhs), reduce($/) ]) }) })
} else {
$fo.with_args($/, $fa, @vargs[0])
}
}

make self.whatever_postcheck($/, $st, reduce());
make self.whatever_postcheck($/, $st, reduce($/));
}

method LIST($/) {
Expand Down Expand Up @@ -3195,8 +3197,8 @@ method install_sub($/, $sub, :$multiness is copy, :$scope is copy, :$class,
$sub.class = $class;
$sub.returnable = True;

my $std = $/.CURSOR;
(sub () {
my $std = $/.CURSOR;
if $sub.name ~~ /^(\w+)\:\<(.*)\>$/ {
my %new = %( $std.default_O(~$0, ~$1) );
$sub.extend.<prec> = %new;
Expand Down

0 comments on commit d3c5fc0

Please sign in to comment.