Skip to content

Commit

Permalink
try to hint at what you can't adverb (rather than just "that")
Browse files Browse the repository at this point in the history
  • Loading branch information
timo committed Apr 29, 2015
1 parent cbf849f commit bcf3f1c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Perl6/Actions.nqp
Expand Up @@ -5160,7 +5160,7 @@ Compilation unit '$file' contained the following violations:
$target := $target[0];
}
unless nqp::istype($target, QAST::Op) && ($target.op eq 'call' || $target.op eq 'callmethod') {
$/.CURSOR.typed_panic('X::Syntax::Adverb');
$/.CURSOR.typed_panic('X::Syntax::Adverb', what => $target.name);
}
my $cpast := $<colonpair>.ast;
$cpast[2].named(compile_time_value_str($cpast[1], 'LHS of pair', $/));
Expand Down
4 changes: 3 additions & 1 deletion src/core/Exception.pm
Expand Up @@ -1143,7 +1143,9 @@ my class X::Syntax::CannotMeta does X::Syntax {
}

my class X::Syntax::Adverb does X::Syntax {
method message() { "You can't adverb that" }
has $.what;

method message() { "You can't adverb " ~ ($.what // "that") }
}

my class X::Syntax::Regex::Adverb does X::Syntax {
Expand Down

0 comments on commit bcf3f1c

Please sign in to comment.