[svn:parrot] r36366 - trunk/languages/pod/src/parser
kjs at svn.parrot.org
kjs at svn.parrot.org
Wed Feb 4 22:54:31 UTC 2009
Author: kjs
Date: Wed Feb 4 22:54:31 2009
New Revision: 36366
URL: https://trac.parrot.org/parrot/changeset/36366
Log:
[pod] paragraph, formatted text. all of this needs to be looked into more carefully, especially the whole thing with blocks and lists: these can be nested, so they must be stored on stacks, and they must have "current block" variables, so to add =items and other stuff to the current list/block.
Modified:
trunk/languages/pod/src/parser/actions.pm
trunk/languages/pod/src/parser/grammar.pg
Modified: trunk/languages/pod/src/parser/actions.pm
==============================================================================
--- trunk/languages/pod/src/parser/actions.pm Wed Feb 4 22:48:08 2009 (r36365)
+++ trunk/languages/pod/src/parser/actions.pm Wed Feb 4 22:54:31 2009 (r36366)
@@ -76,6 +76,18 @@
make Pod::DocTree::Text.new( :name("text") );
}
+method paragraph($/) {
+ my $par := Pod::DocTree::Paragraph.new();
+ for $<formatted_text> {
+ $par.push( $( $_ ) );
+ }
+ make $par;
+}
+
+method formatted_text($/) {
+ make Pod::DocTree::Text.new( :name(~$/) );
+}
+
# Local Variables:
# mode: cperl
# cperl-indent-level: 4
Modified: trunk/languages/pod/src/parser/grammar.pg
==============================================================================
--- trunk/languages/pod/src/parser/grammar.pg Wed Feb 4 22:48:08 2009 (r36365)
+++ trunk/languages/pod/src/parser/grammar.pg Wed Feb 4 22:54:31 2009 (r36366)
@@ -139,7 +139,7 @@
<!before '='> # Not a directive
[ <formatted_text> \n ]+
<.blank_line>
-
+ {*}
}
regex literal_paragraph {
@@ -168,6 +168,7 @@
| <punct>
| <pod_ws>
]+
+ {*}
}
regex format_code {
More information about the parrot-commits
mailing list