Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Parse empty lines in a =begin code block
  • Loading branch information
Mouq committed Feb 19, 2014
1 parent e2b8379 commit f3b5470
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions src/Perl6/Actions.nqp
Expand Up @@ -582,11 +582,12 @@ class Perl6::Actions is HLL::Actions does STDActions {
method delimited_code_content($/) {
if $<pod_string> {
my @t := Perl6::Pod::merge_twines($<pod_string>);
@t.push($<delimited_code_content>.ast);
@t.push($<delimited_code_content>.ast)
if $<delimited_code_content><pod_string>;
make @t;
}
else {
make "";
} elsif $<delimited_code_content> {
# Empty line
make $*W.add_constant('Str', 'str', '').compile_time_value;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/Perl6/Grammar.nqp
Expand Up @@ -703,7 +703,7 @@ grammar Perl6::Grammar is HLL::Grammar does STD {
^^ $spaces
[
|| '=end' \h+ 'code' <pod_newline>
|| <pod_string>**1 <pod_newline>
|| <pod_string>**0..1 <pod_newline>
<delimited_code_content($spaces)>
]
}
Expand Down

0 comments on commit f3b5470

Please sign in to comment.