Skip to content

Commit

Permalink
Show sub-signatures in .signature.perl.
Browse files Browse the repository at this point in the history
  • Loading branch information
jnthn committed Apr 5, 2010
1 parent eaac605 commit 1795a2e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/core/Signature.pm
Expand Up @@ -45,11 +45,12 @@ augment class Signature {

# Slurpiness, namedness, then the name.
if $param.slurpy { take '*' }
for @($param.named_names) -> $name {
my @names = @($param.named_names);
for @names -> $name {
take ':' ~ $name ~ '(';
}
take $name;
take ')' x $param.named_names.elems;
take ')' x +@names;

# Optionality.
if $param.optional && !$param.named && !$param.default { take '?' }
Expand All @@ -60,6 +61,11 @@ augment class Signature {
if $cons_perl ne 'Bool::True' {
take ' where ' ~ $cons_perl;
}

# Any sub-signature?
if $param.signature {
take ' ' ~ substr($param.signature.perl, 1);
}

# Default.
if $param.default {
Expand Down

0 comments on commit 1795a2e

Please sign in to comment.