Author: particle
Date: Thu Feb 21 10:44:10 2008
New Revision: 25939

Modified:
   trunk/languages/perl6/src/utils/perl6doc/actions.pm
   trunk/languages/perl6/src/utils/perl6doc/grammar.pg

Log:
[rakudo perl6doc]capture pod bodies, and process pod options

Modified: trunk/languages/perl6/src/utils/perl6doc/actions.pm
==============================================================================
--- trunk/languages/perl6/src/utils/perl6doc/actions.pm (original)
+++ trunk/languages/perl6/src/utils/perl6doc/actions.pm Thu Feb 21 10:44:10 2008
@@ -30,9 +30,9 @@
 }
 
 
-method pod_comment($/, $key?) {
+method pod_comment($/) {
     my $past := PAST::Val.new(
-        :value( ~$<block> ),
+        :value( ~$<block> ~ "\n" ),
         :node( $/ )
     );
 

Modified: trunk/languages/perl6/src/utils/perl6doc/grammar.pg
==============================================================================
--- trunk/languages/perl6/src/utils/perl6doc/grammar.pg (original)
+++ trunk/languages/perl6/src/utils/perl6doc/grammar.pg Thu Feb 21 10:44:10 2008
@@ -33,26 +33,33 @@
 }
 
 token pod_delimited_block {
-    ^^ '=' <.unsp>? 'begin' <.ws> <block_type> <pod_option>* \n
-    .*?
+    ^^ '=' <.unsp>? 'begin' <.ws> <block_type> <pod_numbered>? <pod_option>* \n
+    $<body>=(.*?):!
     ^^ '=' <.unsp>? 'end'   <.ws> $<block_type> \N*
     {*}
 }
 
+token pod_numbered { <.ws> '#' <.ws> }
+
 token pod_option {
-    [ \n '=' ]? <.ws> $<option>=[ ':' <ident> ]
+    [ \n '=' ]? <.ws>
+    $<option>=[ ':' [
+      | [ nested | numbered | term | formatted | like | allow ] >>
+      | <ident>
+      ]
+    ]
 }
 
 token pod_paragraph_block {
     ^^ '=for' <.ws> <block_type> <pod_option>* \n
-    .*?
+    $<body>=(.*?):!
     <.before \n ^^ [ '=' | \h* $$ ]>
     {*}
 }
 
 token pod_abbreviated_block {
     ^^ '=' <block_type> <.ws>
-    .*?
+    $<body>=(.*?):!
     <.before \n ^^ [ '=' | \h* $$ ]>
 }
 

Reply via email to