Skip to content

Commit

Permalink
Allow colonpairs to appear after Pod block declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
Tadeusz Sośnierz committed Aug 9, 2011
1 parent 083287a commit 62bd6a7
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/Perl6/Grammar.pm
Expand Up @@ -198,6 +198,7 @@ grammar Perl6::Grammar is HLL::Grammar {
<pod_code_parent> { $*ALLOW_CODE := 1 }
|| <identifier>
]
[ \h <colonpair> ]?
<pod_newline>+
[
<pod_content> *
Expand All @@ -209,6 +210,7 @@ grammar Perl6::Grammar is HLL::Grammar {
token pod_block:sym<delimited_raw> {
^^ \h* '=begin' \h+ <!before 'END'>
$<type>=[ 'code' || 'comment' ]
[ \h <colonpair> ]?
<pod_newline>+
[
$<pod_content> = [ .*? ]
Expand All @@ -218,7 +220,7 @@ grammar Perl6::Grammar is HLL::Grammar {
}

token pod_block:sym<delimited_table> {
^^ \h* '=begin' \h+ 'table' <pod_newline>+
^^ \h* '=begin' \h+ 'table' [ \h <colonpair> ]? <pod_newline>+
[
<table_row>*
^^ \h* '=end' \h+ 'table' <pod_newline>
Expand Down Expand Up @@ -248,20 +250,21 @@ grammar Perl6::Grammar is HLL::Grammar {
:my $*ALLOW_CODE := 0;
'=for' \h+ <!before 'END'>
$<type> = <identifier>

[ \h <colonpair> ]?
<pod_newline>
$<pod_content> = <pod_textcontent>?
}

token pod_block:sym<paragraph_raw> {
^^ \h* '=for' \h+ <!before 'END'>
$<type>=[ 'code' || 'comment' ]
[ \h <colonpair> ]?
<pod_newline>
$<pod_content> = [ \h* <!before '=' \w> \N+ \n ]+
}

token pod_block:sym<paragraph_table> {
^^ \h* '=for' \h+ 'table' <pod_newline>
^^ \h* '=for' \h+ 'table' [ \h <colonpair> ]? <pod_newline>
[ <!before \h* \n> <table_row>]*
}

Expand All @@ -273,17 +276,19 @@ grammar Perl6::Grammar is HLL::Grammar {
:my $*ALLOW_CODE := 0;
'=' <!before begin || end || for || END>
$<type> = <identifier>
[ \h <colonpair> ]?
\s
$<pod_content> = <pod_textcontent>?
}

token pod_block:sym<abbreviated_raw> {
^^ \h* '=' $<type>=[ 'code' || 'comment' ] \s
^^ \h* '=' $<type>=[ 'code' || 'comment' ]
[ \h <colonpair> ]?\s
$<pod_content> = [ \h* <!before '=' \w> \N+ \n ]*
}

token pod_block:sym<abbreviated_table> {
^^ \h* '=table' <pod_newline>
^^ \h* '=table' [ \h <colonpair> ]? <pod_newline>
[ <!before \h* \n> <table_row>]*
}

Expand Down

0 comments on commit 62bd6a7

Please sign in to comment.