Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
throw typed ex for "You cant adverb that"
  • Loading branch information
FROGGS committed Apr 17, 2015
1 parent 4e8a163 commit e55c80b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Perl6/Actions.nqp
Expand Up @@ -5094,7 +5094,7 @@ class Perl6::Actions is HLL::Actions does STDActions {
$target := $target[0];
}
unless nqp::istype($target, QAST::Op) && ($target.op eq 'call' || $target.op eq 'callmethod') {
$/.CURSOR.panic("You can't adverb that");
$/.CURSOR.typed_panic('X::Syntax::Adverb');
}
my $cpast := $<colonpair>.ast;
$cpast[2].named(compile_time_value_str($cpast[1], 'LHS of pair', $/));
Expand Down
4 changes: 4 additions & 0 deletions src/core/Exception.pm
Expand Up @@ -1125,6 +1125,10 @@ my class X::Syntax::Can'tMeta does X::Syntax {
}
}

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

my class X::Syntax::Regex::Adverb does X::Syntax {
has $.adverb;
has $.construct;
Expand Down

0 comments on commit e55c80b

Please sign in to comment.