Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Allow bare sigils in a signature, which gets some more spectests pass…
…ing, resolves RT#63146 and brings us another tiny step closer to STD.pm.
  • Loading branch information
jnthn committed Feb 25, 2009
1 parent 798236b commit a5bad9a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/parser/actions.pm
Expand Up @@ -1225,7 +1225,7 @@ method parameter($/) {
$var.named( $sigil eq '%' );
}
elsif $<named> eq ':' { # named
$var.named(~$<param_var><identifier>);
$var.named(~$<param_var><identifier>[0]);
if $quant ne '!' { # required (optional is default)
$var.viviself(container_itype($sigil));
}
Expand Down Expand Up @@ -1302,9 +1302,9 @@ method param_var($/) {
my $sigil := ~$<sigil>;
my $twigil := ~$<twigil>[0];
if $sigil eq '&' { $sigil := ''; }
my $name := $sigil ~ $twigil ~ ~$<identifier>;
my $name := $sigil ~ $twigil ~ ~$<identifier>[0];
if $twigil eq '.' {
$name := $sigil ~ '!' ~ $<identifier>;
$name := $sigil ~ '!' ~ $<identifier>[0];
}
elsif $twigil && $twigil ne '!' {
$/.panic('Invalid twigil used in signature parameter.');
Expand Down
5 changes: 4 additions & 1 deletion src/parser/grammar.pg
Expand Up @@ -489,7 +489,10 @@ rule post_constraint {
}

token param_var {
<sigil> <twigil>? [ <identifier> || $<identifier>=['/'] ]
<sigil> <twigil>? [
|| <identifier>
|| $<identifier>=['/'|'!']
]?
{*}
}

Expand Down

0 comments on commit a5bad9a

Please sign in to comment.