Created
August 4, 2011 17:28
-
-
Save tadzik/1125695 to your computer and use it in GitHub Desktop.
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/Pod.pm b/src/Perl6/Pod.pm | |
index bfbdbd3..f537fc0 100644 | |
--- a/src/Perl6/Pod.pm | |
+++ b/src/Perl6/Pod.pm | |
@@ -1,5 +1,19 @@ | |
# various helper methods for Pod parsing and processing | |
class Perl6::Pod { | |
+ our sub document($what, $with) { | |
+ unless %*COMPILING<%?OPTIONS><setting> eq 'NULL' { | |
+ my $true := $*ST.add_constant('Int', 'int', 1)<compile_time_value>; | |
+ my $doc := $*ST.add_constant('Str', 'str', $with)<compile_time_value>; | |
+ $*ST.apply_trait('&trait_mod:<is>', $what, $doc, :docs($true)); | |
+ | |
+ # add it to $=POD | |
+ my $block := serialize_object( | |
+ 'Pod::Block::Declarator', :attache($what), :doc([$doc]), | |
+ ); | |
+ $*POD_BLOCKS.push($block<compile_time_value>); | |
+ } | |
+ } | |
+ | |
our sub any_block($/) { | |
my @children := []; | |
my $type; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment