Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
heredoc cheating on blocks and on use as well
  • Loading branch information
TimToady committed Apr 10, 2015
1 parent d5e2d1e commit 53593e5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Perl6/Grammar.nqp
Expand Up @@ -174,7 +174,7 @@ role STD {
}

token cheat_heredoc {
[ <?{ +@herestub_queue }> \h* <[ ; } ]> <.ws> <?MARKER('endstmt')> ]?
<?{ +@herestub_queue }> \h* <[ ; } ]> <.ws> <?MARKER('endstmt')>
}

method queue_heredoc($delim, $lang) {
Expand Down Expand Up @@ -1463,7 +1463,7 @@ grammar Perl6::Grammar is HLL::Grammar does STD {
<statementlist(1)>
[
<?> <?{ $*moreinput }>
| '}' { $*MOREINPUT_BLOCK_DEPTH := $*MOREINPUT_BLOCK_DEPTH - 1 }
| [<.cheat_heredoc> || '}'] { $*MOREINPUT_BLOCK_DEPTH := $*MOREINPUT_BLOCK_DEPTH - 1 }
]
<?ENDSTMT>
| <?terminator> { $*W.throw($/, 'X::Syntax::Missing', what =>'block') }
Expand Down Expand Up @@ -1677,7 +1677,7 @@ grammar Perl6::Grammar is HLL::Grammar does STD {
}
}
[
|| <.spacey> <arglist> <?{ $<arglist><EXPR> }>
|| <.spacey> <arglist> <.cheat_heredoc>? <?{ $<arglist><EXPR> }>
{
my $lnd := $*W.dissect_longname($longname);
my $name := $lnd.name;
Expand Down Expand Up @@ -1842,7 +1842,7 @@ grammar Perl6::Grammar is HLL::Grammar does STD {
}

token blorst {
[ <?[{]> <block> | <![;]> <statement> || <.missing: 'block or statement'> ]
[ <?[{]> <block> | <![;]> <statement> <.cheat_heredoc>? || <.missing: 'block or statement'> ]
}

## Statement modifiers
Expand Down Expand Up @@ -3181,7 +3181,7 @@ grammar Perl6::Grammar is HLL::Grammar does STD {
|| <.missing: "initializer on constant declaration">
]

<.cheat_heredoc>
<.cheat_heredoc>?
}

proto token initializer { <...> }
Expand Down

0 comments on commit 53593e5

Please sign in to comment.