Skip to content

Commit

Permalink
A little STD alignment.
Browse files Browse the repository at this point in the history
Gets us a panic where STD has one and we lacked it, plus a bogus
statement error that was also missing.
  • Loading branch information
jnthn committed Dec 8, 2012
1 parent 5e875b4 commit c5e946f
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/Perl6/Grammar.pm
Expand Up @@ -812,6 +812,7 @@ grammar Perl6::Grammar is HLL::Grammar does STD {
:s
[
| $
| <?before <[\)\]\}]>>
| [<statement><.eat_terminator> ]*
]
}
Expand All @@ -837,14 +838,15 @@ grammar Perl6::Grammar is HLL::Grammar does STD {
:my $*SCOPE := '';
:my $*ACTIONS := %*LANG<MAIN-actions>;
<!before <[\])}]> | $ >
<!stopper>
<!!{ nqp::rebless($/.CURSOR, %*LANG<MAIN>) }>
[
| <statement_control>
| <EXPR> :dba('statement end') <.ws>
| <EXPR> :dba('statement end')
[
|| <?MARKED('endstmt')>
|| :dba('statement modifier') <statement_mod_cond> <statement_mod_loop>?
|| :dba('statement modifier loop') <statement_mod_loop>
|| :dba('statement modifier') <.ws> <statement_mod_cond> <statement_mod_loop>?
|| :dba('statement modifier loop') <.ws> <statement_mod_loop>
{
my $sp := $<EXPR><statement_prefix>;
if $sp && $sp<sym> eq 'do' {
Expand All @@ -853,15 +855,19 @@ grammar Perl6::Grammar is HLL::Grammar does STD {
}
}
]?
]
| <?before ';'>
| <?before <stopper> >
| {} <.panic: "Bogus statement">
]
}

token eat_terminator {
|| ';'
|| <?MARKED('endstmt')>
|| <?terminator>
|| <?before ')' | ']' | '}' >
|| $
|| <?stopper>
|| <.typed_panic: 'X::Syntax::Confused'>
}

token xblock($*IMPLICIT = 0) {
Expand Down

0 comments on commit c5e946f

Please sign in to comment.