Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
typed exception for numeric parameter
  • Loading branch information
moritz committed Feb 24, 2012
1 parent ad349d5 commit 1ccc79f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Perl6/Grammar.pm
Expand Up @@ -1648,7 +1648,7 @@ grammar Perl6::Grammar is HLL::Grammar {
| <sigil> <twigil>?
[
|| <name=.identifier>
|| <name=.decint> <.panic: "Cannot declare a numeric parameter">
|| <name=.decint> { $*W.throw($/, 'X::Syntax::Variable::Numeric', what => 'parameter') }
|| $<name>=[<[/!]>]
]?
}
Expand Down
3 changes: 2 additions & 1 deletion src/core/Exceptions.pm
Expand Up @@ -199,7 +199,8 @@ my class X::Syntax::NegatedPair does X::Syntax {
}

my class X::Syntax::Variable::Numeric does X::Syntax {
method message() { 'Cannot declare a numeric variable' }
has $.what = 'variable';
method message() { "Cannot declare a numeric $.what" }
}

my class X::Syntax::Variable::Match does X::Syntax {
Expand Down

0 comments on commit 1ccc79f

Please sign in to comment.