Skip to content

Commit 491eec9

Browse files
committed
so many search and replace. probably too many.
1 parent af36e92 commit 491eec9

File tree

6 files changed

+153
-153
lines changed

6 files changed

+153
-153
lines changed

src/HLL/Actions.pm

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,10 @@ class HLL::Actions {
9090
}
9191
}
9292
if $key eq 'POSTFIX' {
93-
$past.unshift($/[0].ast);
93+
nqp::unshift($past, $/[0].ast);
9494
}
9595
else {
96-
for $/.list { if nqp::defined($_.ast) { $past.push($_.ast); } }
96+
for $/.list { if nqp::defined($_.ast) { nqp::push($past, $_.ast); } }
9797
}
9898
make $past;
9999
}
@@ -120,7 +120,7 @@ class HLL::Actions {
120120
my @words := HLL::Grammar::split_words($/, $past.value);
121121
if +@words != 1 {
122122
$past := QAST::Op.new( :op('list'), :node($/) );
123-
for @words { $past.push(QAST::SVal.new( :value($_) )); }
123+
for @words { nqp::push($past, QAST::SVal.new( :value($_) )); }
124124
}
125125
else {
126126
$past := QAST::SVal.new( :value(~@words[0]) );
@@ -146,18 +146,18 @@ class HLL::Actions {
146146
}
147147
else {
148148
if $lastlit gt '' {
149-
@parts.push(QAST::SVal.new( :value($lastlit) ));
149+
nqp::push(@parts, QAST::SVal.new( :value($lastlit) ));
150150
}
151-
@parts.push(nqp::istype($ast, QAST::Node)
151+
nqp::push(@parts, nqp::istype($ast, QAST::Node)
152152
?? $ast
153153
!! QAST::SVal.new( :value($ast) ));
154154
$lastlit := '';
155155
}
156156
}
157-
if $lastlit gt '' { @parts.push(QAST::SVal.new( :value($lastlit) )); }
158-
my $past := @parts ?? @parts.shift !! QAST::SVal.new( :value('') );
157+
if $lastlit gt '' { nqp::push(@parts, QAST::SVal.new( :value($lastlit) )); }
158+
my $past := @parts ?? nqp::shift(@parts) !! QAST::SVal.new( :value('') );
159159
while @parts {
160-
$past := QAST::Op.new( $past, @parts.shift, :op('concat') );
160+
$past := QAST::Op.new( $past, nqp::shift(@parts), :op('concat') );
161161
}
162162
make $past;
163163
}

src/NQP/Actions.pm

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ class NQP::Actions is HLL::Actions {
88
$block.blocktype('immediate');
99
unless $block.symtable() {
1010
my $stmts := QAST::Stmts.new( :node($block.node) );
11-
for $block.list { $stmts.push($_); }
11+
for $block.list { nqp::push($stmts, $_); }
1212
$block := $stmts;
1313
}
1414
$block;
1515
}
1616

1717
sub default_for($sigil) {
1818
if $sigil eq '@' {
19-
QAST::Op.new( :op('list') )
19+
QAST::Op.new( :op('qlist') )
2020
}
2121
elsif $sigil eq '%' {
2222
QAST::Op.new( :op('hash') )
@@ -49,7 +49,7 @@ class NQP::Actions is HLL::Actions {
4949
sub colonpair_str($ast) {
5050
if nqp::istype($ast, QAST::Op) {
5151
my @parts;
52-
for $ast.list { @parts.push($_.value) }
52+
for $ast.list { nqp::push(@parts, $_.value) }
5353
join(' ', @parts)
5454
} else {
5555
$ast.value
@@ -64,7 +64,7 @@ class NQP::Actions is HLL::Actions {
6464
# (CTXSAVE is inherited from HLL::Actions.) Don't do this when
6565
# there was an explicit {YOU_ARE_HERE}.
6666
unless $*HAS_YOU_ARE_HERE {
67-
$unit.push( self.CTXSAVE() );
67+
nqp::push($unit, self.CTXSAVE() );
6868
}
6969

7070
# Detect if we're the main unit by if we were given any args. If so,
@@ -73,7 +73,7 @@ class NQP::Actions is HLL::Actions {
7373
# mainline.
7474
$unit.unshift(QAST::Var.new( :scope('lexical'), :name('@ARGS'), :decl('param'), :slurpy(1) ));
7575
if $*MAIN_SUB {
76-
$mainline.push(QAST::Op.new(
76+
nqp::push($mainline, QAST::Op.new(
7777
:op('if'),
7878
QAST::Var.new( :scope('lexical'), :name('@ARGS') ),
7979
QAST::Op.new(
@@ -84,10 +84,10 @@ class NQP::Actions is HLL::Actions {
8484
}
8585

8686
# Push mainline statements into UNIT.
87-
$unit.push($mainline);
87+
nqp::push($unit, $mainline);
8888

8989
# Load the needed libraries.
90-
$unit.push($*W.libs());
90+
nqp::push($unit, $*W.libs());
9191

9292
# Wrap everything in a QAST::CompUnit.
9393
my $compunit := QAST::CompUnit.new(
@@ -136,11 +136,11 @@ class NQP::Actions is HLL::Actions {
136136
$ast := $ast<sink> if nqp::defined($ast<sink>);
137137
if $ast<bareblock> { $ast := block_immediate($ast[0]); }
138138
$ast := QAST::Stmts.new($ast) if nqp::istype($ast, QAST::Node);
139-
$past.push( $ast );
139+
nqp::push($past, $ast );
140140
}
141141
}
142142
else {
143-
$past.push(default_for('$'));
143+
nqp::push($past, default_for('$'));
144144
}
145145
make $past;
146146
}
@@ -192,11 +192,11 @@ class NQP::Actions is HLL::Actions {
192192
if %*HANDLERS {
193193
$past := QAST::Op.new( :op('handle'), $past );
194194
for %*HANDLERS {
195-
$past.push($_.key);
196-
$past.push($_.value);
195+
nqp::push($past, $_.key);
196+
nqp::push($past, $_.value);
197197
}
198198
}
199-
$BLOCK.push($past);
199+
nqp::push($BLOCK, $past);
200200
$BLOCK.node($/);
201201
$BLOCK<handlers> := %*HANDLERS if %*HANDLERS;
202202
make $BLOCK;
@@ -268,14 +268,14 @@ class NQP::Actions is HLL::Actions {
268268
my $count := +$<xblock> - 1;
269269
my $past := xblock_immediate( $<xblock>[$count].ast );
270270
if $<else> {
271-
$past.push( block_immediate( $<else>[0].ast ) );
271+
nqp::push($past, block_immediate( $<else>[0].ast ) );
272272
}
273273
# build if/then/elsif structure
274274
while $count > 0 {
275275
$count--;
276276
my $else := $past;
277277
$past := xblock_immediate( $<xblock>[$count].ast );
278-
$past.push($else);
278+
nqp::push($past, $else);
279279
}
280280
make $past;
281281
}
@@ -290,7 +290,7 @@ class NQP::Actions is HLL::Actions {
290290
my $past := xblock_immediate( $<xblock>.ast );
291291
$past.op(~$<sym>);
292292
unless $*CONTROL_USED {
293-
$past.push(QAST::IVal.new( :value(1), :named('nohandler') ));
293+
nqp::push($past, QAST::IVal.new( :value(1), :named('nohandler') ));
294294
}
295295
make $past;
296296
}
@@ -307,7 +307,7 @@ class NQP::Actions is HLL::Actions {
307307
:op($op), :node($/) );
308308
}
309309
unless $*CONTROL_USED {
310-
$past.push(QAST::IVal.new( :value(1), :named('nohandler') ));
310+
nqp::push($past, QAST::IVal.new( :value(1), :named('nohandler') ));
311311
}
312312
make $past;
313313
}
@@ -317,13 +317,13 @@ class NQP::Actions is HLL::Actions {
317317
$past.op('for');
318318
my $block := $past[1];
319319
unless $block.arity {
320-
$block[0].push( QAST::Var.new( :name('$_'), :scope('lexical'), :decl('param') ) );
320+
nqp::push($block[0], QAST::Var.new( :name('$_'), :scope('lexical'), :decl('param') ) );
321321
$block.symbol('$_', :scope('lexical') );
322322
$block.arity(1);
323323
}
324324
$block.blocktype('immediate');
325325
unless $*CONTROL_USED {
326-
$past.push(QAST::IVal.new( :value(1), :named('nohandler') ));
326+
nqp::push($past, QAST::IVal.new( :value(1), :named('nohandler') ));
327327
}
328328
make $past;
329329
}
@@ -379,7 +379,7 @@ class NQP::Actions is HLL::Actions {
379379
}
380380

381381
method statement_prefix:sym<INIT>($/) {
382-
$*W.cur_lexpad().push($<blorst>.ast);
382+
nqp::push($*W.cur_lexpad(), $<blorst>.ast);
383383
make QAST::Stmts.new();
384384
}
385385

@@ -484,12 +484,12 @@ class NQP::Actions is HLL::Actions {
484484
QAST::SVal.new( :value('Contextual ' ~ ~$/ ~ ' not found') )
485485
));
486486
$past := QAST::VarWithFallback.new(
487-
:name(~@name.pop), :scope('contextual'),
487+
:name(~nqp::pop(@name)), :scope('contextual'),
488488
:fallback($global_fallback)
489489
);
490490
}
491491
elsif $<twigil>[0] eq '!' {
492-
my $name := ~@name.pop;
492+
my $name := ~nqp::pop(@name);
493493
my $ch;
494494
if $*PKGDECL eq 'role' {
495495
$ch := QAST::Var.new( :name('$?CLASS'), :scope('lexical') );
@@ -535,7 +535,7 @@ class NQP::Actions is HLL::Actions {
535535
$past.fallback( default_for( $<sigil> ) );
536536
}
537537
else {
538-
my $name := ~@name.pop;
538+
my $name := ~nqp::pop(@name);
539539
if $*IN_DECL eq 'variable' || $name eq '$_' || $name eq '$/'
540540
|| $name eq '$!' || $<twigil>[0] eq '?' || $*W.is_lexical($name) {
541541
$past := QAST::Var.new( :name($name), :scope('lexical') );
@@ -584,7 +584,7 @@ class NQP::Actions is HLL::Actions {
584584
method package_def($/) {
585585
# Get name and meta-object.
586586
my @ns := nqp::clone($<name><identifier>);
587-
my $name := ~@ns.pop;
587+
my $name := ~nqp::pop(@ns);
588588
my $how := %*HOW{$*PKGDECL};
589589

590590
# Get the body code.
@@ -594,7 +594,7 @@ class NQP::Actions is HLL::Actions {
594594
}
595595
else {
596596
$past := $*W.pop_lexpad();
597-
$past.push($<statementlist>.ast);
597+
nqp::push($past, $<statementlist>.ast);
598598
}
599599

600600
# Evaluate everything in the package in-line unless this is a generic
@@ -608,11 +608,11 @@ class NQP::Actions is HLL::Actions {
608608
);
609609
if $<role_params> {
610610
for $<role_params>[0]<variable> {
611-
$params.push($_.ast);
611+
nqp::push($params, $_.ast);
612612
}
613613
}
614-
$past.unshift($params);
615-
$past.push(QAST::Op.new( :op('curlexpad') ));
614+
nqp::unshift($past, $params);
615+
nqp::push($past, QAST::Op.new( :op('curlexpad') ));
616616
$past.symbol('$?CLASS', :scope('lexical'));
617617
$*W.pkg_set_body_block($*PACKAGE, $past);
618618
$*W.install_lexical_symbol($past, '$?PACKAGE', $*PACKAGE);
@@ -775,7 +775,7 @@ class NQP::Actions is HLL::Actions {
775775
else {
776776
$default := default_for($sigil);
777777
}
778-
$BLOCK[0].push(QAST::Op.new(
778+
nqp::push($BLOCK[0], QAST::Op.new(
779779
:op('bind'), :node($/),
780780
QAST::Var.new( :name($name), :scope('lexical'), :decl('var'), :returns($type) ),
781781
$default
@@ -856,7 +856,7 @@ class NQP::Actions is HLL::Actions {
856856

857857
# Ensure we emit the code block.
858858
my $BLOCK := $*W.cur_lexpad();
859-
$BLOCK[0].push($past);
859+
nqp::push($BLOCK[0], $past);
860860
}
861861
elsif $*MULTINESS eq 'proto' {
862862
# Create a candidate list holder for the dispatchees
@@ -865,7 +865,7 @@ class NQP::Actions is HLL::Actions {
865865
if $*SCOPE eq 'our' { nqp::die('our-scoped protos not yet implemented') }
866866
my $code := $*W.create_code($past, $name, 1);
867867
my $BLOCK := $*W.cur_lexpad();
868-
$BLOCK[0].push(QAST::Op.new(
868+
nqp::push($BLOCK[0], QAST::Op.new(
869869
:op('bind'),
870870
QAST::Var.new( :name('&' ~ $name), :scope('lexical'), :decl('var') ),
871871
$past
@@ -874,20 +874,20 @@ class NQP::Actions is HLL::Actions {
874874

875875
# Also stash the current lexical dispatcher and capture, for the {*}
876876
# to resolve.
877-
$block[0].push(QAST::Op.new(
877+
nqp::push($block[0], QAST::Op.new(
878878
:op('bind'),
879879
QAST::Var.new( :name('CURRENT_DISPATCH_CAPTURE'), :scope('lexical'), :decl('var') ),
880880
QAST::Op.new( :op('savecapture') )
881881
));
882-
$block[0].push(QAST::Op.new(
882+
nqp::push($block[0], QAST::Op.new(
883883
:op('bind'),
884884
QAST::Var.new( :name('&*CURRENT_DISPATCHER'), :scope('lexical'), :decl('var') ),
885885
QAST::Op.new( :op('getcodeobj'), QAST::Op.new( :op('curcode') ) )
886886
));
887887
}
888888
else {
889889
my $BLOCK := $*W.cur_lexpad();
890-
$BLOCK[0].push(QAST::Op.new(
890+
nqp::push($BLOCK[0], QAST::Op.new(
891891
:op('bind'),
892892
QAST::Var.new( :name('&' ~ $name), :scope('lexical'), :decl('var') ),
893893
$past
@@ -1435,19 +1435,19 @@ class NQP::Actions is HLL::Actions {
14351435
method circumfix:sym<( )>($/) {
14361436
make $<EXPR>
14371437
?? $<EXPR>[0].ast
1438-
!! QAST::Op.new( :op('list'), :node($/) );
1438+
!! QAST::Op.new( :op('qlist'), :node($/) );
14391439
}
14401440

14411441
method circumfix:sym<[ ]>($/) {
14421442
my $past;
14431443
if $<EXPR> {
14441444
$past := $<EXPR>[0].ast;
14451445
unless nqp::istype($past, QAST::Op) && $past.name eq '&infix:<,>' {
1446-
$past := QAST::Op.new( $past, :op('list') );
1446+
$past := QAST::Op.new( $past, :op('qlist') );
14471447
}
14481448
}
14491449
else {
1450-
$past := QAST::Op.new( :op('list') );
1450+
$past := QAST::Op.new( :op('qlist') );
14511451
}
14521452
$past.name('&circumfix:<[ ]>');
14531453
make $past;
@@ -1576,7 +1576,7 @@ class NQP::Actions is HLL::Actions {
15761576

15771577
# The final lookup will always be just a keyed access to a
15781578
# symbol table.
1579-
my $final_name := @name.pop();
1579+
my $final_name := nqp::pop(@name);
15801580
my $lookup := QAST::VarWithFallback.new(
15811581
:scope('associative'),
15821582
QAST::SVal.new( :value(~$final_name) )
@@ -1750,12 +1750,12 @@ class NQP::RegexActions is QRegex::P6Regex::Actions {
17501750
:node($/), :name($name),
17511751
QAST::Node.new( QAST::SVal.new( :value($name) ) ) );
17521752
if $<arglist> {
1753-
for $<arglist>[0].ast.list { $qast[0].push( $_ ) }
1753+
for $<arglist>[0].ast.list { nqp::push($qast[0], $_ ) }
17541754
}
17551755
elsif $<nibbler> {
17561756
$name eq 'after' ??
1757-
$qast[0].push(self.qbuildsub(self.flip_ast($<nibbler>[0].ast), :anon(1), :addself(1))) !!
1758-
$qast[0].push(self.qbuildsub($<nibbler>[0].ast, :anon(1), :addself(1)));
1757+
nqp::push($qast[0], self.qbuildsub(self.flip_ast($<nibbler>[0].ast), :anon(1), :addself(1))) !!
1758+
nqp::push($qast[0], self.qbuildsub($<nibbler>[0].ast, :anon(1), :addself(1)));
17591759
}
17601760
}
17611761
make $qast;
@@ -1784,7 +1784,7 @@ class NQP::RegexActions is QRegex::P6Regex::Actions {
17841784
method store_regex_alt_nfa($code_obj, $block, $key, @alternatives) {
17851785
my @saved;
17861786
for @alternatives {
1787-
@saved.push($_.save(:non_empty));
1787+
nqp::push(@saved, $_.save(:non_empty));
17881788
}
17891789
$code_obj.SET_ALT_NFA($key, @saved);
17901790
}

0 commit comments

Comments
 (0)