diff --git a/src/Perl6/Actions.pm b/src/Perl6/Actions.pm index f5762daf41d..2a2bf9d86d8 100644 --- a/src/Perl6/Actions.pm +++ b/src/Perl6/Actions.pm @@ -682,6 +682,9 @@ method variable($/) { $past := $.ast; $past.unshift( PAST::Var.new( :name('$/') ) ); } + elsif $ { + $past := PAST::Op.new( :pirop('find_sub_not_null__Ps'), '&infix:<' ~ $.Str ~ '>' ); + } else { $past := make_variable($/, ~$/); } diff --git a/src/Perl6/Grammar.pm b/src/Perl6/Grammar.pm index ef7bdbacbbd..f2059d91817 100644 --- a/src/Perl6/Grammar.pm +++ b/src/Perl6/Grammar.pm @@ -728,11 +728,17 @@ token variable { } }> {} [ - | ? - | - | $=[\d+] - | - | $=['$'] $=[<[/_!]>] + || '&' + [ + | '[' ~ ']' + ] + || [ + | ? + | + | $=[\d+] + | + | $=['$'] $=[<[/_!]>] + ] ] [ && $[0] eq '.' }> [ <.unsp> | '\\' | ]