File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -1559,8 +1559,9 @@ class NQP::Actions is HLL::Actions {
1559
1559
1560
1560
method postfix :sym <. >($/ ) { make $ < dotty > . ast; }
1561
1561
1562
- method prefix :sym <return >($/ ) {
1563
- make QAST ::Op. new ( : op(' call' ), : name(' RETURN' ) );
1562
+ method term :sym <return >($/ ) {
1563
+ make QAST ::Op. new ( : op(' call' ), : name(' RETURN' ),
1564
+ $ < EXPR > ?? $ < EXPR > . ast !! QAST ::WVal. new ( : value($ * W . find_sym([' NQPMu' ])) ));
1564
1565
}
1565
1566
1566
1567
method prefix :sym <make >($/ ) {
Original file line number Diff line number Diff line change @@ -629,7 +629,7 @@ grammar NQP::Grammar is HLL::Grammar {
629
629
}
630
630
631
631
token term :sym <name > {
632
- <name > <args >** 0.. 1
632
+ <name > <?{ ~ $ < name > ne ' return ' }> < args >** 0.. 1
633
633
}
634
634
635
635
token args {
@@ -796,8 +796,8 @@ grammar NQP::Grammar is HLL::Grammar {
796
796
797
797
token infix :sym <, > { <sym > <O (' %comma, :op<list>' )> }
798
798
799
- token prefix :sym <return > { <sym > \s <O (' %list_prefix' )> { $ * RETURN_USED := 1 } }
800
799
token prefix :sym <make > { <sym > \s <O (' %list_prefix' )> }
800
+ token term :sym <return > { <sym > [\s <EXPR >]? { $ * RETURN_USED := 1 } }
801
801
802
802
method smartmatch ($/ ) {
803
803
# swap rhs into invocant position
You can’t perform that action at this time.
0 commit comments