@@ -8,15 +8,15 @@ class NQP::Actions is HLL::Actions {
8
8
$ block . blocktype(' immediate' );
9
9
unless $ block . symtable() {
10
10
my $ stmts := QAST ::Stmts. new ( : node($ block . node) );
11
- for $ block . list { $ stmts . push ($ _ ); }
11
+ for $ block . list { nqp :: push ($ stmts , $ _ ); }
12
12
$ block := $ stmts ;
13
13
}
14
14
$ block ;
15
15
}
16
16
17
17
sub default_for ($ sigil ) {
18
18
if $ sigil eq ' @' {
19
- QAST ::Op. new ( : op(' list ' ) )
19
+ QAST ::Op. new ( : op(' qlist ' ) )
20
20
}
21
21
elsif $ sigil eq ' %' {
22
22
QAST ::Op. new ( : op(' hash' ) )
@@ -49,7 +49,7 @@ class NQP::Actions is HLL::Actions {
49
49
sub colonpair_str ($ ast ) {
50
50
if nqp ::istype($ ast , QAST ::Op) {
51
51
my @ parts ;
52
- for $ ast . list { @ parts . push ($ _ . value ) }
52
+ for $ ast . list { nqp :: push (@ parts , $ _ . value ) }
53
53
join (' ' , @ parts )
54
54
} else {
55
55
$ ast . value
@@ -64,7 +64,7 @@ class NQP::Actions is HLL::Actions {
64
64
# (CTXSAVE is inherited from HLL::Actions.) Don't do this when
65
65
# there was an explicit {YOU_ARE_HERE}.
66
66
unless $ * HAS_YOU_ARE_HERE {
67
- $ unit . push ( self . CTXSAVE() );
67
+ nqp :: push ($ unit , self . CTXSAVE() );
68
68
}
69
69
70
70
# 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 {
73
73
# mainline.
74
74
$ unit . unshift (QAST ::Var. new ( : scope(' lexical' ), : name(' @ARGS' ), : decl(' param' ), : slurpy(1 ) ));
75
75
if $ * MAIN_SUB {
76
- $ mainline . push (QAST ::Op. new (
76
+ nqp :: push ($ mainline , QAST ::Op. new (
77
77
: op(' if' ),
78
78
QAST ::Var. new ( : scope(' lexical' ), : name(' @ARGS' ) ),
79
79
QAST ::Op. new (
@@ -84,10 +84,10 @@ class NQP::Actions is HLL::Actions {
84
84
}
85
85
86
86
# Push mainline statements into UNIT.
87
- $ unit . push ($ mainline );
87
+ nqp :: push ($ unit , $ mainline );
88
88
89
89
# Load the needed libraries.
90
- $ unit . push ($ * W . libs());
90
+ nqp :: push ($ unit , $ * W . libs());
91
91
92
92
# Wrap everything in a QAST::CompUnit.
93
93
my $ compunit := QAST ::CompUnit. new (
@@ -136,11 +136,11 @@ class NQP::Actions is HLL::Actions {
136
136
$ ast := $ ast <sink > if nqp :: defined ($ ast <sink >);
137
137
if $ ast <bareblock > { $ ast := block_immediate($ ast [0 ]); }
138
138
$ ast := QAST ::Stmts. new ($ ast ) if nqp ::istype($ ast , QAST ::Node);
139
- $ past . push ( $ ast );
139
+ nqp :: push ($ past , $ ast );
140
140
}
141
141
}
142
142
else {
143
- $ past . push (default_for(' $' ));
143
+ nqp :: push ($ past , default_for(' $' ));
144
144
}
145
145
make $ past ;
146
146
}
@@ -192,11 +192,11 @@ class NQP::Actions is HLL::Actions {
192
192
if % * HANDLERS {
193
193
$ past := QAST ::Op. new ( : op(' handle' ), $ past );
194
194
for % * HANDLERS {
195
- $ past . push ($ _ . key );
196
- $ past . push ($ _ . value );
195
+ nqp :: push ($ past , $ _ . key );
196
+ nqp :: push ($ past , $ _ . value );
197
197
}
198
198
}
199
- $ BLOCK . push ($ past );
199
+ nqp :: push ($ BLOCK , $ past );
200
200
$ BLOCK . node($/ );
201
201
$ BLOCK <handlers > := % * HANDLERS if % * HANDLERS ;
202
202
make $ BLOCK ;
@@ -268,14 +268,14 @@ class NQP::Actions is HLL::Actions {
268
268
my $ count := + $ < xblock > - 1 ;
269
269
my $ past := xblock_immediate( $ < xblock > [$ count ]. ast );
270
270
if $ < else > {
271
- $ past . push ( block_immediate( $ < else > [0 ]. ast ) );
271
+ nqp :: push ($ past , block_immediate( $ < else > [0 ]. ast ) );
272
272
}
273
273
# build if/then/elsif structure
274
274
while $ count > 0 {
275
275
$ count -- ;
276
276
my $ else := $ past ;
277
277
$ past := xblock_immediate( $ < xblock > [$ count ]. ast );
278
- $ past . push ($ else );
278
+ nqp :: push ($ past , $ else );
279
279
}
280
280
make $ past ;
281
281
}
@@ -290,7 +290,7 @@ class NQP::Actions is HLL::Actions {
290
290
my $ past := xblock_immediate( $ < xblock > . ast );
291
291
$ past . op(~ $ < sym > );
292
292
unless $ * CONTROL_USED {
293
- $ past . push (QAST ::IVal. new ( : value(1 ), : named(' nohandler' ) ));
293
+ nqp :: push ($ past , QAST ::IVal. new ( : value(1 ), : named(' nohandler' ) ));
294
294
}
295
295
make $ past ;
296
296
}
@@ -307,7 +307,7 @@ class NQP::Actions is HLL::Actions {
307
307
: op($ op ), : node($/ ) );
308
308
}
309
309
unless $ * CONTROL_USED {
310
- $ past . push (QAST ::IVal. new ( : value(1 ), : named(' nohandler' ) ));
310
+ nqp :: push ($ past , QAST ::IVal. new ( : value(1 ), : named(' nohandler' ) ));
311
311
}
312
312
make $ past ;
313
313
}
@@ -317,13 +317,13 @@ class NQP::Actions is HLL::Actions {
317
317
$ past . op(' for' );
318
318
my $ block := $ past [1 ];
319
319
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' ) ) );
321
321
$ block . symbol(' $_' , : scope(' lexical' ) );
322
322
$ block . arity (1 );
323
323
}
324
324
$ block . blocktype(' immediate' );
325
325
unless $ * CONTROL_USED {
326
- $ past . push (QAST ::IVal. new ( : value(1 ), : named(' nohandler' ) ));
326
+ nqp :: push ($ past , QAST ::IVal. new ( : value(1 ), : named(' nohandler' ) ));
327
327
}
328
328
make $ past ;
329
329
}
@@ -379,7 +379,7 @@ class NQP::Actions is HLL::Actions {
379
379
}
380
380
381
381
method statement_prefix :sym <INIT >($/ ) {
382
- $ * W . cur_lexpad(). push ( $ < blorst > . ast);
382
+ nqp :: push ( $ * W . cur_lexpad(), $ < blorst > . ast);
383
383
make QAST ::Stmts. new ();
384
384
}
385
385
@@ -484,12 +484,12 @@ class NQP::Actions is HLL::Actions {
484
484
QAST ::SVal. new ( : value(' Contextual ' ~ ~ $/ ~ ' not found' ) )
485
485
));
486
486
$ past := QAST ::VarWithFallback. new (
487
- : name(~ @ name . pop ), : scope(' contextual' ),
487
+ : name(~ nqp :: pop ( @ name ) ), : scope(' contextual' ),
488
488
: fallback($ global_fallback )
489
489
);
490
490
}
491
491
elsif $ < twigil > [0 ] eq ' !' {
492
- my $ name := ~ @ name . pop ;
492
+ my $ name := ~ nqp :: pop ( @ name ) ;
493
493
my $ ch ;
494
494
if $ * PKGDECL eq ' role' {
495
495
$ ch := QAST ::Var. new ( : name(' $?CLASS' ), : scope(' lexical' ) );
@@ -535,7 +535,7 @@ class NQP::Actions is HLL::Actions {
535
535
$ past . fallback( default_for( $ < sigil > ) );
536
536
}
537
537
else {
538
- my $ name := ~ @ name . pop ;
538
+ my $ name := ~ nqp :: pop ( @ name ) ;
539
539
if $ * IN_DECL eq ' variable' || $ name eq ' $_' || $ name eq ' $/'
540
540
|| $ name eq ' $!' || $ < twigil > [0 ] eq ' ?' || $ * W . is_lexical($ name ) {
541
541
$ past := QAST ::Var. new ( : name($ name ), : scope(' lexical' ) );
@@ -584,7 +584,7 @@ class NQP::Actions is HLL::Actions {
584
584
method package_def ($/ ) {
585
585
# Get name and meta-object.
586
586
my @ ns := nqp :: clone ($ < name >< identifier > );
587
- my $ name := ~ @ ns . pop ;
587
+ my $ name := ~ nqp :: pop ( @ ns ) ;
588
588
my $ how := % * HOW {$ * PKGDECL };
589
589
590
590
# Get the body code.
@@ -594,7 +594,7 @@ class NQP::Actions is HLL::Actions {
594
594
}
595
595
else {
596
596
$ past := $ * W . pop_lexpad();
597
- $ past . push ($ < statementlist > . ast);
597
+ nqp :: push ($ past , $ < statementlist > . ast);
598
598
}
599
599
600
600
# Evaluate everything in the package in-line unless this is a generic
@@ -608,11 +608,11 @@ class NQP::Actions is HLL::Actions {
608
608
);
609
609
if $ < role_params > {
610
610
for $ < role_params > [0 ]<variable > {
611
- $ params . push ($ _ . ast);
611
+ nqp :: push ($ params , $ _ . ast);
612
612
}
613
613
}
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' ) ));
616
616
$ past . symbol(' $?CLASS' , : scope(' lexical' ));
617
617
$ * W . pkg_set_body_block($ * PACKAGE , $ past );
618
618
$ * W . install_lexical_symbol($ past , ' $?PACKAGE' , $ * PACKAGE );
@@ -775,7 +775,7 @@ class NQP::Actions is HLL::Actions {
775
775
else {
776
776
$ default := default_for($ sigil );
777
777
}
778
- $ BLOCK [0 ]. push ( QAST ::Op. new (
778
+ nqp :: push ( $ BLOCK [0 ], QAST ::Op. new (
779
779
: op(' bind' ), : node($/ ),
780
780
QAST ::Var. new ( : name($ name ), : scope(' lexical' ), : decl(' var' ), : returns($ type ) ),
781
781
$ default
@@ -856,7 +856,7 @@ class NQP::Actions is HLL::Actions {
856
856
857
857
# Ensure we emit the code block.
858
858
my $ BLOCK := $ * W . cur_lexpad();
859
- $ BLOCK [0 ]. push ( $ past );
859
+ nqp :: push ( $ BLOCK [0 ], $ past );
860
860
}
861
861
elsif $ * MULTINESS eq ' proto' {
862
862
# Create a candidate list holder for the dispatchees
@@ -865,7 +865,7 @@ class NQP::Actions is HLL::Actions {
865
865
if $ * SCOPE eq ' our' { nqp ::die(' our-scoped protos not yet implemented' ) }
866
866
my $ code := $ * W . create_code($ past , $ name , 1 );
867
867
my $ BLOCK := $ * W . cur_lexpad();
868
- $ BLOCK [0 ]. push ( QAST ::Op. new (
868
+ nqp :: push ( $ BLOCK [0 ], QAST ::Op. new (
869
869
: op(' bind' ),
870
870
QAST ::Var. new ( : name(' &' ~ $ name ), : scope(' lexical' ), : decl(' var' ) ),
871
871
$ past
@@ -874,20 +874,20 @@ class NQP::Actions is HLL::Actions {
874
874
875
875
# Also stash the current lexical dispatcher and capture, for the {*}
876
876
# to resolve.
877
- $ block [0 ]. push ( QAST ::Op. new (
877
+ nqp :: push ( $ block [0 ], QAST ::Op. new (
878
878
: op(' bind' ),
879
879
QAST ::Var. new ( : name(' CURRENT_DISPATCH_CAPTURE' ), : scope(' lexical' ), : decl(' var' ) ),
880
880
QAST ::Op. new ( : op(' savecapture' ) )
881
881
));
882
- $ block [0 ]. push ( QAST ::Op. new (
882
+ nqp :: push ( $ block [0 ], QAST ::Op. new (
883
883
: op(' bind' ),
884
884
QAST ::Var. new ( : name(' &*CURRENT_DISPATCHER' ), : scope(' lexical' ), : decl(' var' ) ),
885
885
QAST ::Op. new ( : op(' getcodeobj' ), QAST ::Op. new ( : op(' curcode' ) ) )
886
886
));
887
887
}
888
888
else {
889
889
my $ BLOCK := $ * W . cur_lexpad();
890
- $ BLOCK [0 ]. push ( QAST ::Op. new (
890
+ nqp :: push ( $ BLOCK [0 ], QAST ::Op. new (
891
891
: op(' bind' ),
892
892
QAST ::Var. new ( : name(' &' ~ $ name ), : scope(' lexical' ), : decl(' var' ) ),
893
893
$ past
@@ -1435,19 +1435,19 @@ class NQP::Actions is HLL::Actions {
1435
1435
method circumfix :sym < ( )> ($/ ) {
1436
1436
make $ < EXPR >
1437
1437
?? $ < EXPR > [0 ]. ast
1438
- !! QAST ::Op. new ( : op(' list ' ), : node($/ ) );
1438
+ !! QAST ::Op. new ( : op(' qlist ' ), : node($/ ) );
1439
1439
}
1440
1440
1441
1441
method circumfix :sym < [ ]> ($/ ) {
1442
1442
my $ past ;
1443
1443
if $ < EXPR > {
1444
1444
$ past := $ < EXPR > [0 ]. ast;
1445
1445
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 ' ) );
1447
1447
}
1448
1448
}
1449
1449
else {
1450
- $ past := QAST ::Op. new ( : op(' list ' ) );
1450
+ $ past := QAST ::Op. new ( : op(' qlist ' ) );
1451
1451
}
1452
1452
$ past . name (' &circumfix:<[ ]>' );
1453
1453
make $ past ;
@@ -1576,7 +1576,7 @@ class NQP::Actions is HLL::Actions {
1576
1576
1577
1577
# The final lookup will always be just a keyed access to a
1578
1578
# symbol table.
1579
- my $ final_name := @ name . pop ();
1579
+ my $ final_name := nqp :: pop (@ name );
1580
1580
my $ lookup := QAST ::VarWithFallback. new (
1581
1581
: scope(' associative' ),
1582
1582
QAST ::SVal. new ( : value(~ $ final_name ) )
@@ -1750,12 +1750,12 @@ class NQP::RegexActions is QRegex::P6Regex::Actions {
1750
1750
: node($/ ), : name($ name ),
1751
1751
QAST ::Node. new ( QAST ::SVal. new ( : value($ name ) ) ) );
1752
1752
if $ < arglist > {
1753
- for $ < arglist > [0 ]. ast. list { $ qast [0 ]. push ( $ _ ) }
1753
+ for $ < arglist > [0 ]. ast. list { nqp :: push ( $ qast [0 ], $ _ ) }
1754
1754
}
1755
1755
elsif $ < nibbler > {
1756
1756
$ 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 )));
1759
1759
}
1760
1760
}
1761
1761
make $ qast ;
@@ -1784,7 +1784,7 @@ class NQP::RegexActions is QRegex::P6Regex::Actions {
1784
1784
method store_regex_alt_nfa ($ code_obj , $ block , $ key , @ alternatives ) {
1785
1785
my @ saved ;
1786
1786
for @ alternatives {
1787
- @ saved . push ($ _ . save(: non_empty));
1787
+ nqp :: push (@ saved , $ _ . save(: non_empty));
1788
1788
}
1789
1789
$ code_obj . SET_ALT_NFA($ key , @ saved );
1790
1790
}
0 commit comments