Permalink
Browse files

Small tunes in Pod::To::Text, sanitize newline handling, interpret pa…

…ckage declarators correctly
  • Loading branch information...
1 parent c61a8d5 commit 083287a0692970b1191608968201cda6d7dc68c5 @tadzik tadzik committed Aug 9, 2011
Showing with 10 additions and 7 deletions.
  1. +9 −6 lib/Pod/To/Text.pm
  2. +1 −1 src/Perl6/Actions.pm
View
@@ -4,12 +4,12 @@ sub pod2text($pod) is export {
my @declarators;
given $pod {
when Pod::Heading { heading2text($pod) }
- when Pod::Block::Code { code2text($pod) ~ "\n\n" }
- when Pod::Block::Named { named2text($pod) ~ "\n" }
- when Pod::Block::Para { para2text($pod) ~ "\n\n" }
+ when Pod::Block::Code { code2text($pod) }
+ when Pod::Block::Named { named2text($pod) }
+ when Pod::Block::Para { para2text($pod) }
when Pod::Block::Declarator { declarator2text($pod) }
- when Pod::Item { item2text($pod) ~ "\n" }
- when Positional { $pod.map({pod2text($_)}).join }
+ when Pod::Item { item2text($pod) }
+ when Positional { $pod.map({pod2text($_)}).join("\n\n")}
default { $pod.Str }
}
}
@@ -53,7 +53,10 @@ sub declarator2text($pod) {
when nqp::p6bool(nqp::istype($_.HOW, Metamodel::ModuleHOW)) {
'module'
}
- } ~ ' ' ~ $pod.WHEREFORE.perl ~ ': ' ~ $pod.WHEREFORE.WHY ~ "\n"
+ when nqp::p6bool(nqp::istype($_.HOW, Metamodel::PackageHOW)) {
+ 'package'
+ }
+ } ~ ' ' ~ $pod.WHEREFORE.perl ~ ': ' ~ $pod.WHEREFORE.WHY
}
# vim: ft=perl6
View
@@ -246,7 +246,7 @@ class Perl6::Actions is HLL::Actions {
$block.push(
PAST::Op.new(
:pasttype<call>, :node($/),
- :name('&print'), $pod2text,
+ :name('&say'), $pod2text,
),
);
$*ST.pop_lexpad();

0 comments on commit 083287a

Please sign in to comment.