Skip to content

Commit

Permalink
advise on "elif", too
Browse files Browse the repository at this point in the history
  • Loading branch information
timo committed Mar 12, 2013
1 parent ed1dd58 commit 838e03d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/Perl6/Grammar.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1056,6 +1056,7 @@ grammar Perl6::Grammar is HLL::Grammar does STD {
[
[
| 'else'\h*'if' <.typed_panic: 'X::Syntax::Malformed::Elsif'>
| 'elif' { $/.CURSOR.typed_panic('X::Syntax::Malformed::Elsif', what => "elif") }
| 'elsif'\s <xblock>
]
]*
Expand Down
3 changes: 2 additions & 1 deletion src/core/Exception.pm
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,8 @@ my class X::Syntax::UnlessElse does X::Syntax {
}

my class X::Syntax::Malformed::Elsif does X::Syntax {
method message() { 'please use "elsif" instead of "else if"' }
has $.what = 'else if';
method message() { qq{In Perl 6, please use "elsif' instead of "$.what"} }
}

my class X::Syntax::Reserved does X::Syntax {
Expand Down

0 comments on commit 838e03d

Please sign in to comment.