Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Separate =code etc. from =comment in grammar
  • Loading branch information
Mouq committed Feb 18, 2014
1 parent 230a54b commit 0bc8fb7
Showing 1 changed file with 27 additions and 6 deletions.
33 changes: 27 additions & 6 deletions src/Perl6/Grammar.nqp
Expand Up @@ -633,14 +633,14 @@ grammar Perl6::Grammar is HLL::Grammar does STD {
[ [\n $spaces '=']? \h+ <colonpair> ]*
}
token pod_block:sym<delimited_raw> {
token pod_block:sym<delimited_comment> {
^^
$<spaces> = [ \h* ]
'=begin' \h+ $<type>=[ 'code' | 'comment' ] {}
'=begin' \h+ 'comment' {}
<pod_configuration($<spaces>)> <pod_newline>+
[
$<pod_content> = [ .*? ]
^^ $<spaces> '=end' \h+ $<type> <pod_newline>
^^ $<spaces> '=end' \h+ 'comment' <pod_newline>
|| <.typed_panic: 'X::Syntax::Pod::BeginWithoutEnd'>
]
}
Expand Down Expand Up @@ -684,6 +684,19 @@ grammar Perl6::Grammar is HLL::Grammar does STD {
]
}

token pod_block:sym<delimited_code> {
^^
$<spaces> = [ \h* ]
'=begin' \h+ 'code'
:my $*POD_ALLOW_FCODES := 0;
<pod_configuration($<spaces>)> <pod_newline>+
[
<pod_content>*
^^ \h* '=end' \h+ 'code' <pod_newline>
|| <.typed_panic: 'X::Syntax::Pod::BeginWithoutEnd'>
]
}

token table_row {
\h* <!before '=' \w> \N* \n
}
Expand Down Expand Up @@ -751,10 +764,10 @@ grammar Perl6::Grammar is HLL::Grammar does STD {
<pod_content=.pod_textcontent>**0..1
}

token pod_block:sym<abbreviated_raw> {
token pod_block:sym<abbreviated_comment> {
^^
$<spaces> = [ \h* ]
'=' $<type>=[ 'code' | 'comment' ]
'=comment'
:my $*POD_ALLOW_FCODES := nqp::getlexdyn('$*POD_ALLOW_FCODES');
<pod_configuration($<spaces>)> [\r\n|\s]
$<pod_content> = [ \h* <!before '=' \w> \N+ \n ]*
Expand All @@ -763,11 +776,19 @@ grammar Perl6::Grammar is HLL::Grammar does STD {
token pod_block:sym<abbreviated_table> {
^^
$<spaces> = [ \h* ]
:my $*POD_ALLOW_FCODES := nqp::getlexdyn('$*POD_ALLOW_FCODES');
'=table' <pod_configuration($<spaces>)> <pod_newline>
:my $*POD_ALLOW_FCODES := nqp::getlexdyn('$*POD_ALLOW_FCODES');
[ <!before \h* \n> <table_row>]*
}

token pod_block:sym<abbreviated_code> {
^^
$<spaces> = [ \h* ]
'=code' <pod_configuration($<spaces>)> <pod_newline>
:my $*POD_ALLOW_FCODES := 0;
[ <!before \h* \n> <pod_content>]*
}

token pod_newline {
\h* \n
}
Expand Down

0 comments on commit 0bc8fb7

Please sign in to comment.