@@ -1001,9 +1001,10 @@ class NQP::Actions is HLL::Actions {
1001
1001
if $ < invocant > {
1002
1002
my $ inv := $ < invocant > [0 ]. ast;
1003
1003
$ BLOCKINIT . push ($ inv );
1004
- $ BLOCKINIT . push (QAST ::Var. new (
1005
- : name(' self' ), : scope(' lexical' ), : decl(' var' ),
1006
- : viviself(PAST::Var. new ( : scope(' lexical' ), : name($ inv . name ) ))
1004
+ $ BLOCKINIT . push (QAST ::Op. new (
1005
+ : op(' bind' ),
1006
+ QAST ::Var. new ( : name(' self' ), : scope(' lexical' ), : decl(' var' ) ),
1007
+ QAST ::Var. new ( : scope(' lexical' ), : name($ inv . name ) )
1007
1008
));
1008
1009
$ BLOCK <signature_has_invocant > := 1
1009
1010
}
@@ -1016,7 +1017,7 @@ class NQP::Actions is HLL::Actions {
1016
1017
if $ < named_param > {
1017
1018
$ past := $ < named_param > . ast;
1018
1019
if $ quant ne ' !' {
1019
- $ past . viviself( vivitype ($ < named_param >< param_var >< sigil > ) );
1020
+ $ past . default( default_for ($ < named_param >< param_var >< sigil > ) );
1020
1021
}
1021
1022
}
1022
1023
else {
@@ -1026,7 +1027,7 @@ class NQP::Actions is HLL::Actions {
1026
1027
$ past . named( $ < param_var >< sigil > eq ' %' );
1027
1028
}
1028
1029
elsif $ quant eq ' ?' {
1029
- $ past . viviself( vivitype ($ < param_var >< sigil > ) );
1030
+ $ past . default( default_for ($ < param_var >< sigil > ) );
1030
1031
}
1031
1032
}
1032
1033
if $ < default_value > {
@@ -1036,14 +1037,13 @@ class NQP::Actions is HLL::Actions {
1036
1037
if $ quant eq ' !' {
1037
1038
$/ . CURSOR. panic(" Can't put default on required parameter" );
1038
1039
}
1039
- $ past . viviself ( $ < default_value > [0 ]<EXPR >. ast );
1040
+ $ past . default ( $ < default_value > [0 ]<EXPR >. ast );
1040
1041
}
1041
- unless $ past . viviself { $ * W . cur_lexpad(). arity ( + $ * W . cur_lexpad(). arity + 1 ); }
1042
+ unless $ past . default { $ * W . cur_lexpad(). arity ( + $ * W . cur_lexpad(). arity + 1 ); }
1042
1043
1043
- # Note: this is hijacking multitype a bit here comapred to what it was
1044
- # originally used for (a textual name). But it's ignored
1044
+ # Set the type of the parameter.
1045
1045
if $ < typename > {
1046
- $ past . multitype ($ < typename > [0 ]. ast);
1046
+ $ past . returns ($ < typename > [0 ]. ast. value );
1047
1047
}
1048
1048
1049
1049
# Set definedness flag (XXX want a better way to do this).
@@ -1143,9 +1143,10 @@ class NQP::Actions is HLL::Actions {
1143
1143
else {
1144
1144
my $ block := $ * W . pop_lexpad();
1145
1145
$ block [0 ]. unshift (QAST ::Var. new (: name<self >, : scope<lexical >, : decl<param >));
1146
- $ block [0 ]. push (
1147
- QAST ::Var. new (: name<self >, : scope<local >, : decl<var >,
1148
- : viviself(PAST::Var. new ( : name<self >, : scope(' lexical_6model' ) ))));
1146
+ $ block [0 ]. push (QAST ::Op. new (
1147
+ : op(' bind' ),
1148
+ QAST ::Var. new (: name<self >, : scope<local >, : decl<var > ),
1149
+ QAST ::Var. new ( : name<self >, : scope(' lexical' ) )));
1149
1150
$ block [0 ]. push (QAST ::Var. new (: name<$¢ >, : scope<lexical >, : decl<var >));
1150
1151
$ block [0 ]. push (QAST ::Var. new (: name<$/ >, : scope<lexical >, : decl<var >));
1151
1152
$ block . symbol(' $¢' , : scope<lexical >);
@@ -1330,21 +1331,15 @@ class NQP::Actions is HLL::Actions {
1330
1331
method semilist ($/ ) { make $ < statement > . ast }
1331
1332
1332
1333
method postcircumfix :sym < [ ]> ($/ ) {
1333
- make PAST::Var. new ( $ < EXPR > . ast , : scope(' keyed_int' ),
1334
- : viviself(' Undef' ),
1335
- : vivibase(vivitype(' @' )) );
1334
+ make QAST ::Op. new ( : op(' atpos' ), $ < EXPR > . ast );
1336
1335
}
1337
1336
1338
1337
method postcircumfix :sym < { }> ($/ ) {
1339
- make PAST::Var. new ( $ < EXPR > . ast , : scope(' keyed' ),
1340
- : viviself(' Undef' ),
1341
- : vivibase(vivitype(' %' )) );
1338
+ make QAST ::Op. new ( : op(' atkey' ), $ < EXPR > . ast );
1342
1339
}
1343
1340
1344
1341
method postcircumfix :sym <ang >($/ ) {
1345
- make PAST::Var. new ( $ < quote_EXPR > . ast, : scope(' keyed' ),
1346
- : viviself(' Undef' ),
1347
- : vivibase(vivitype(' %' )) );
1342
+ make QAST ::Op. new ( : op(' atkey' ), $ < EXPR > . ast );
1348
1343
}
1349
1344
1350
1345
method postcircumfix :sym < ( )> ($/ ) {
@@ -1424,9 +1419,10 @@ class NQP::Actions is HLL::Actions {
1424
1419
method quote :sym </ /> ($/ ) {
1425
1420
my $ block := $ * W . pop_lexpad();
1426
1421
$ block [0 ]. push (PAST::Var. new (: name<self >, : scope<parameter >));
1427
- $ block [0 ]. push (
1428
- PAST::Var. new (: name<self >, : scope<register >, : isdecl(1 ),
1429
- : viviself(PAST::Var. new ( : name<self >, : scope(' lexical_6model' ) ))));
1422
+ $ block [0 ]. push (QAST ::Op. new (
1423
+ : op(' bind' ),
1424
+ QAST ::Var. new (: name<self >, : scope<register >, : isdecl(1 ) ),
1425
+ QAST ::Var. new ( : name<self >, : scope(' lexical' ) )));
1430
1426
$ block [0 ]. push (PAST::Var. new (: name<$¢ >, : scope<lexical >, : isdecl(1 )));
1431
1427
$ block [0 ]. push (PAST::Var. new (: name<$/ >, : scope<lexical >, : isdecl(1 )));
1432
1428
$ block . symbol(' $¢' , : scope<lexical >);
0 commit comments