Skip to content

Commit

Permalink
Fix pod directives formatting codes in delimited code blocks.
Browse files Browse the repository at this point in the history
This makes handling of pod directives in code blocks consistent whether
or not you've wrapped it in a multi-line (and :allow'd) formatting code.

In delimited code blocks, the only pod directive that can't be stuffed
in formatting codes is the same one that can't be in a delimited code
block in the first place: =end code. For other code blocks and that pod
directive in particular, you'll need to keep = from being the first
non-whitespace character, same as before.
  • Loading branch information
ShimmerFairy committed Apr 18, 2014
1 parent 7cf9cad commit e63497d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Perl6/Grammar.nqp
Expand Up @@ -636,7 +636,10 @@ grammar Perl6::Grammar is HLL::Grammar does STD {
token pod_string_character {
<pod_balanced_braces> || <pod_formatting_code> || $<char>=[ \N || [
<?{ $*POD_IN_FORMATTINGCODE == 1}> \n <!before \h* '=' \w>
<?{ $*POD_IN_FORMATTINGCODE }> \n [
<?{ $*POD_DELIMITED_CODE_BLOCK }> <!before \h* '=end' \h+ code> ||
<!before \h* '=' \w>
]
]
]
}
Expand Down Expand Up @@ -704,6 +707,7 @@ grammar Perl6::Grammar is HLL::Grammar does STD {
'=begin' \h+ 'code' {}
:my $*POD_ALLOW_FCODES := 0;
:my $*POD_IN_CODE_BLOCK := 1;
:my $*POD_DELIMITED_CODE_BLOCK := 1;
<pod_configuration($<spaces>)> <pod_newline>+
[
|| <delimited_code_content($<spaces>)>
Expand Down

0 comments on commit e63497d

Please sign in to comment.