Skip to content

Commit

Permalink
include key of negated pair with value in the error message
Browse files Browse the repository at this point in the history
  • Loading branch information
moritz committed Aug 2, 2012
1 parent e1905aa commit d71ad18
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/Perl6/Grammar.pm
Expand Up @@ -956,7 +956,8 @@ grammar Perl6::Grammar is HLL::Grammar {

':'
[
| '!' <identifier> [ <[ \[ \( \< \{ ]> <.typed_panic: "X::Syntax::NegatedPair"> ]?
| '!' <identifier> [ <[ \[ \( \< \{ ]> {
$/.CURSOR.typed_panic('X::Syntax::NegatedPair', key => ~$<identifier>) } ]?
{ $*key := $<identifier>.Str; $*value := 0; }
| <identifier>
{ $*key := $<identifier>.Str; }
Expand Down
3 changes: 2 additions & 1 deletion src/core/Exception.pm
Expand Up @@ -529,7 +529,8 @@ my class X::Syntax::P5 does X::Syntax {
}

my class X::Syntax::NegatedPair does X::Syntax {
method message() { 'Argument not allowed on negated pair' }
has $.key;
method message() { "Argument not allowed on negated pair with key '$.key'" }
}

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

0 comments on commit d71ad18

Please sign in to comment.