Skip to content
This repository has been archived by the owner on Feb 3, 2021. It is now read-only.

Commit

Permalink
At least generate *some* sort of error for things like while(1) and i…
Browse files Browse the repository at this point in the history
…f(2).

We'll improve the error messages in a later commit.
  • Loading branch information
pmichaud committed Nov 18, 2009
1 parent c719911 commit ef88e99
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/NQP/Grammar.pm
Expand Up @@ -147,33 +147,33 @@ token terminator:sym<}> { <?[}]> }
proto token statement_control { <...> }

token statement_control:sym<if> {
<sym> :s
<sym> \s :s
<xblock>
[ 'elsif'\s <xblock> ]*
[ 'else'\s <else=.pblock> ]?
}

token statement_control:sym<unless> {
<sym> :s
<sym> \s :s
<xblock>
[ <!before 'else'> || <.panic: 'unless does not take "else", please rewrite using "if"'> ]
}

token statement_control:sym<while> {
$<sym>=[while|until] :s
$<sym>=[while|until] \s :s
<xblock>
}

token statement_control:sym<repeat> {
<sym> :s
<sym> \s :s
[
| $<wu>=[while|until]\s <xblock>
| <pblock> $<wu>=[while|until]\s <EXPR>
]
}

token statement_control:sym<for> {
<sym> :s
<sym> \s :s
<xblock>
}

Expand Down

0 comments on commit ef88e99

Please sign in to comment.