Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Typed exception for mis-placed |.
  • Loading branch information
jnthn committed Apr 2, 2015
1 parent 10cd401 commit 1457816
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Perl6/Grammar.nqp
Expand Up @@ -4122,7 +4122,7 @@ grammar Perl6::Grammar is HLL::Grammar does STD {
token prefix:sym<^> { <sym> <O('%symbolic_unary')> }
token prefix:sym<|> {
<sym> <O('%symbolic_unary')>
[ <?{ $*ARG_FLAT_OK }> || <.panic: 'Arg-flattening | is only valid in an argument list'> ]
[ <?{ $*ARG_FLAT_OK }> || <.typed_sorry('X::Syntax::ArgFlattener')> ]
}

token infix:sym<*> { <sym> <O('%multiplicative')> }
Expand Down
4 changes: 4 additions & 0 deletions src/core/Exception.pm
Expand Up @@ -1150,6 +1150,10 @@ my class X::Syntax::DuplicatedPrefix does X::Syntax {
}
}

my class X::Syntax::ArgFlattener does X::Syntax {
method message() { "Arg-flattening | is only valid in an argument list" }
}

my class X::Attribute::Package does X::Comp {
has $.package-kind;
has $.name;
Expand Down

0 comments on commit 1457816

Please sign in to comment.