Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add better error message for else blocks on unless - a copy/paste fro…
…m STD.pm.
  • Loading branch information
jnthn committed Feb 13, 2009
1 parent b2e7ac9 commit 19c0210
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/parser/grammar.pg
Expand Up @@ -259,7 +259,9 @@ rule if_statement {
}

rule unless_statement {
$<sym>=[unless] <xblock> {*}
$<sym>=[unless]
<xblock> {*}
[ <!before 'else'> || <.panic: "unless does not take \"else\" in Perl 6; please rewrite using \"if\""> ]
}

rule repeat_statement {
Expand Down

0 comments on commit 19c0210

Please sign in to comment.