Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
typed exception X::Backslash::NonVariableDollar
  • Loading branch information
FROGGS committed Nov 27, 2012
1 parent aa635da commit 7bcefdd
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.pm
Expand Up @@ -3273,7 +3273,7 @@ grammar Perl6::QGrammar is HLL::Grammar does STD {
token escape:sym<$> {
:my $*QSIGIL := '$';
<?before '$'>
[ <EXPR=.LANG('MAIN', 'EXPR', 'y=')> || <.panic: "Non-variable \$ must be backslashed"> ]
[ <EXPR=.LANG('MAIN', 'EXPR', 'y=')> || { $*W.throw($/, 'X::Backslash::NonVariableDollar') } ]
}
}

Expand Down
4 changes: 4 additions & 0 deletions src/core/Exception.pm
Expand Up @@ -806,6 +806,10 @@ my class X::Backslash::UnrecognizedSequence does X::Syntax {
method message() { "Unrecognized backslash sequence: '\\$.sequence'" }
}

my class X::Backslash::NonVariableDollar does X::Syntax {
method message() { "Non-variable \$ must be backslashed" }
}

my class X::ControlFlow is Exception {
has $.illegal; # something like 'next'
has $.enclosing; # .... outside a loop
Expand Down

0 comments on commit 7bcefdd

Please sign in to comment.