Skip to content

Commit

Permalink
Allow intermingling Perl6 terms in NIL
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan O'Rear committed Jul 13, 2010
1 parent ce81a8f commit e7d59a1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
4 changes: 4 additions & 0 deletions Niecza/Actions.pm
Expand Up @@ -528,6 +528,10 @@ sub insn__S_push_null { my ($cl, $M) = @_;
$M->{_ast} = [[ push_null => $M->{clrid}->Str ]];
}

sub insn__S_hll { my ($cl, $M) = @_;
$M->{_ast} = [ $M->{EXPR}{_ast} ];
}

sub clrid {}
sub clrqual {}
sub clrgeneric {}
Expand Down
1 change: 1 addition & 0 deletions Niecza/Grammar.pm6
Expand Up @@ -109,6 +109,7 @@ grammar NIL is STD {
token insn:clr_sfield_set { 'F!' {} <clrid> }
token insn:return { <sym> '/' (<[ 0 1 ]>) }
token insn:push_null { 'null:' {} <clrid> }
token insn:hll { '{' ~ '}' [ :lang(%*LANG<MAIN>) <EXPR> ] }
}

}
Expand Down
8 changes: 6 additions & 2 deletions Op.pm
Expand Up @@ -20,8 +20,12 @@ use 5.010;
sub item_cg {
my ($self, $cg, $body) = @_;
for my $insn (@{ $self->code }) {
my ($op, @args) = @$insn;
$cg->$op(@args);
if (blessed $insn) {
$insn->item_cg($cg, $body);
} else {
my ($op, @args) = @$insn;
$cg->$op(@args);
}
}
}

Expand Down

0 comments on commit e7d59a1

Please sign in to comment.