Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Change op generation for [] and {} from method to sub
  • Loading branch information
lizmat committed Sep 18, 2013
1 parent 2230750 commit 031ff96
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
26 changes: 13 additions & 13 deletions src/Perl6/Actions.nqp
Expand Up @@ -1425,8 +1425,8 @@ class Perl6::Actions is HLL::Actions does STDActions {
method colonpair_variable($/) {
if $<capvar> {
make QAST::Op.new(
:op('callmethod'),
:name('postcircumfix:<{ }>'),
:op('call'),
:name('&postcircumfix:<{ }>'),
QAST::Var.new(:name('$/'), :scope('lexical')),
$*W.add_string_constant(~$<desigilname>)
);
Expand Down Expand Up @@ -1457,8 +1457,8 @@ class Perl6::Actions is HLL::Actions does STDActions {
my $past;
if $<index> {
$past := QAST::Op.new(
:op('callmethod'),
:name('postcircumfix:<[ ]>'),
:op('call'),
:name('&postcircumfix:<[ ]>'),
QAST::Var.new(:name('$/'), :scope('lexical')),
$*W.add_constant('Int', 'int', +$<index>),
);
Expand Down Expand Up @@ -4671,14 +4671,14 @@ class Perl6::Actions is HLL::Actions does STDActions {
make QAST::Op.new( :op('bind'), $target, $source );
}
elsif $target.isa(QAST::Op) && $target.op eq 'hllize' &&
$target[0].isa(QAST::Op) && $target[0].op eq 'callmethod' &&
($target[0].name eq 'postcircumfix:<[ ]>' || $target[0].name eq 'postcircumfix:<{ }>') {
$target[0].isa(QAST::Op) && $target[0].op eq 'call' &&
($target[0].name eq '&postcircumfix:<[ ]>' || $target[0].name eq '&postcircumfix:<{ }>') {
$source.named('BIND');
$target[0].push($source);
make $target;
}
elsif $target.isa(QAST::Op) && $target.op eq 'callmethod' &&
($target.name eq 'postcircumfix:<[ ]>' || $target.name eq 'postcircumfix:<{ }>') {
elsif $target.isa(QAST::Op) && $target.op eq 'call' &&
($target.name eq '&postcircumfix:<[ ]>' || $target.name eq '&postcircumfix:<{ }>') {
$source.named('BIND');
$target.push($source);
make $target;
Expand Down Expand Up @@ -5055,7 +5055,7 @@ class Perl6::Actions is HLL::Actions does STDActions {
}

method postcircumfix:sym<[ ]>($/) {
my $past := QAST::Op.new( :name('postcircumfix:<[ ]>'), :op('callmethod'), :node($/) );
my $past := QAST::Op.new( :name('&postcircumfix:<[ ]>'), :op('call'), :node($/) );
if $<semilist><statement> {
my $slast := $<semilist>.ast;
$past.push($slast);
Expand All @@ -5064,7 +5064,7 @@ class Perl6::Actions is HLL::Actions does STDActions {
}

method postcircumfix:sym<{ }>($/) {
my $past := QAST::Op.new( :name('postcircumfix:<{ }>'), :op('callmethod'), :node($/) );
my $past := QAST::Op.new( :name('&postcircumfix:<{ }>'), :op('call'), :node($/) );
if $<semilist><statement> {
if +$<semilist><statement> > 1 {
$*W.throw($/, 'X::Comp::NYI', feature => 'multi-dimensional indexes');
Expand All @@ -5075,7 +5075,7 @@ class Perl6::Actions is HLL::Actions does STDActions {
}

method postcircumfix:sym<ang>($/) {
my $past := QAST::Op.new( :name('postcircumfix:<{ }>'), :op('callmethod'), :node($/) );
my $past := QAST::Op.new( :name('&postcircumfix:<{ }>'), :op('call'), :node($/) );
my $nib := $<nibble>.ast;
$past.push($nib)
unless nqp::istype($nib, QAST::Stmts) && nqp::istype($nib[0], QAST::Op) &&
Expand All @@ -5084,7 +5084,7 @@ class Perl6::Actions is HLL::Actions does STDActions {
}

method postcircumfix:sym«<< >>»($/) {
my $past := QAST::Op.new( :name('postcircumfix:<{ }>'), :op('callmethod'), :node($/) );
my $past := QAST::Op.new( :name('&postcircumfix:<{ }>'), :op('call'), :node($/) );
my $nib := $<nibble>.ast;
$past.push($nib)
unless nqp::istype($nib, QAST::Stmts) && nqp::istype($nib[0], QAST::Op) &&
Expand All @@ -5093,7 +5093,7 @@ class Perl6::Actions is HLL::Actions does STDActions {
}

method postcircumfix:sym<« »>($/) {
my $past := QAST::Op.new( :name('postcircumfix:<{ }>'), :op('callmethod'), :node($/) );
my $past := QAST::Op.new( :name('&postcircumfix:<{ }>'), :op('call'), :node($/) );
my $nib := $<nibble>.ast;
$past.push($nib)
unless nqp::istype($nib, QAST::Stmts) && nqp::istype($nib[0], QAST::Op) &&
Expand Down
2 changes: 1 addition & 1 deletion src/Perl6/World.nqp
Expand Up @@ -2230,7 +2230,7 @@ class Perl6::World is HLL::World {
);
}
$lookup := QAST::Op.new(
:op('callmethod'), :name('postcircumfix:<{ }>'),
:op('call'), :name('&postcircumfix:<{ }>'),
$lookup,
self.add_string_constant($_));
}
Expand Down

0 comments on commit 031ff96

Please sign in to comment.