Browse files

[Pod::To::Text] Tune and clarify declarator2text() a bit

  • Loading branch information...
1 parent b7b88d7 commit ada28b6d2d3c24ebc323d17e614664b7a8864702 @tadzik tadzik committed Aug 13, 2011
Showing with 6 additions and 2 deletions.
  1. +6 −2 lib/Pod/To/Text.pm
View
8 lib/Pod/To/Text.pm
@@ -56,7 +56,7 @@ sub table2text($pod) {
sub declarator2text($pod) {
next unless $pod.WHEREFORE.WHY;
- do given $pod.WHEREFORE {
+ my $type = do given $pod.WHEREFORE {
when Method {
'method'
}
@@ -72,7 +72,11 @@ sub declarator2text($pod) {
when nqp::p6bool(nqp::istype($_.HOW, Metamodel::PackageHOW)) {
'package'
}
- } ~ ' ' ~ $pod.WHEREFORE.perl ~ ': ' ~ $pod.WHEREFORE.WHY
+ default {
+ ''
+ }
+ }
+ return "$type {$pod.WHEREFORE.perl}: {$pod.WHEREFORE.WHY}"
}
# vim: ft=perl6

0 comments on commit ada28b6

Please sign in to comment.