This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/src/Perl6/Actions.nqp b/src/Perl6/Actions.nqp | |
| index 183467f..1af8fdd 100644 | |
| --- a/src/Perl6/Actions.nqp | |
| +++ b/src/Perl6/Actions.nqp | |
| @@ -3540,19 +3540,24 @@ class Perl6::Actions is HLL::Actions does STDActions { | |
| my int $param_idx := 0; | |
| my int $multi_invocant := 1; | |
| for $<parameter> { | |
| - my %info := $_.ast; | |
| - %info<is_multi_invocant> := $multi_invocant; | |
| - my $sep := @*seps[$param_idx]; | |
| - if ~$sep eq ':' { | |
| - if $param_idx != 0 { | |
| - $*W.throw($/, 'X::Syntax::Signature::InvocantMarker') | |
| - } | |
| - %info<is_invocant> := 1; | |
| + if ~$_ eq '*' { | |
| + @parameter_infos.push({}); | |
| } | |
| - elsif ~$sep eq ';;' { | |
| - $multi_invocant := 0; | |
| + else { | |
| + my %info := $_.ast; | |
| + %info<is_multi_invocant> := $multi_invocant; | |
| + my $sep := @*seps[$param_idx]; | |
| + if ~$sep eq ':' { | |
| + if $param_idx != 0 { | |
| + $*W.throw($/, 'X::Syntax::Signature::InvocantMarker') | |
| + } | |
| + %info<is_invocant> := 1; | |
| + } | |
| + elsif ~$sep eq ';;' { | |
| + $multi_invocant := 0; | |
| + } | |
| + @parameter_infos.push(%info); | |
| } | |
| - @parameter_infos.push(%info); | |
| $param_idx := $param_idx + 1; | |
| } | |
| %signature<parameters> := @parameter_infos; | |
| diff --git a/src/Perl6/Grammar.nqp b/src/Perl6/Grammar.nqp | |
| index fa8a306..6bd032d 100644 | |
| --- a/src/Perl6/Grammar.nqp | |
| +++ b/src/Perl6/Grammar.nqp | |
| @@ -2458,7 +2458,7 @@ grammar Perl6::Grammar is HLL::Grammar does STD { | |
| <.ws> | |
| [ | |
| | <?before '-->' | ')' | ']' | '{' | ':'\s | ';;' > | |
| - | [ <parameter> || <.malformed('parameter')> ] | |
| + | [ <parameter> || $<parameter>='*' || <.malformed('parameter')> ] | |
| ]+ % <param_sep> | |
| <.ws> | |
| { $*IN_DECL := ''; } |
Author
FROGGS
commented
Apr 22, 2014
--> allow my $x; ($, $, $x) = 1, 2, 3 instead
http://irclog.perlgeek.de/perl6/2014-04-24#i_8633629
<FROGGS> m: my
<camelia> rakudo-moar 502241: OUTPUT«3»
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment