Skip to content

Commit

Permalink
reorder pod parsing rules
Browse files Browse the repository at this point in the history
  • Loading branch information
moritz committed Jun 7, 2012
1 parent 4ebbdbd commit 4545eb9
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions src/Perl6/Grammar.pm
Expand Up @@ -258,6 +258,20 @@ grammar Perl6::Grammar is HLL::Grammar {

proto token pod_block { <...> }

token pod_block:sym<delimited_raw> {
^^
$<spaces> = [ \h* ]
'=begin' \h+ <!before 'END'>
$<type>=[ 'code' || 'comment' ]
[ [\n '=']? \h+ <colonpair> ]*
<pod_newline>+
[
$<pod_content> = [ .*? ]
^^ $<spaces> '=end' \h+ $<type> <pod_newline>
|| <.typed_panic: 'X::Syntax::Pod::BeginWithoutEnd'>
]
}

token pod_block:sym<delimited> {
^^
$<spaces> = [ \h* ]
Expand All @@ -283,19 +297,6 @@ grammar Perl6::Grammar is HLL::Grammar {
]
}

token pod_block:sym<delimited_raw> {
^^
$<spaces> = [ \h* ]
'=begin' \h+ <!before 'END'>
$<type>=[ 'code' || 'comment' ]
[ [\n '=']? \h+ <colonpair> ]*
<pod_newline>+
[
$<pod_content> = [ .*? ]
^^ $<spaces> '=end' \h+ $<type> <pod_newline>
|| <.typed_panic: 'X::Syntax::Pod::BeginWithoutEnd'>
]
}

token pod_block:sym<delimited_table> {
^^ \h* '=begin' \h+ 'table'
Expand Down

0 comments on commit 4545eb9

Please sign in to comment.