Skip to content

Commit

Permalink
Catch 5. decimal error at EOF; typed exception.
Browse files Browse the repository at this point in the history
Resolves and allows us to test RT #93988.
  • Loading branch information
jnthn committed Apr 8, 2015
1 parent 192bf4b commit 816dd64
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
Original file line number Diff line number Diff line change
Expand Up @@ -3430,7 +3430,7 @@ grammar Perl6::Grammar is HLL::Grammar does STD {
]
| <VALUE=decint>
]
<!!before ['.' <?before \s | ',' | '=' | <terminator> > <.sorry: "Decimal point must be followed by digit">]? >
<!!before ['.' <?before \s | ',' | '=' | <terminator> | $ > <.typed_sorry: 'X::Syntax::Number::IllegalDecimal'>]? >
[ <?before '_' '_'+\d> <.sorry: "Only isolated underscores are allowed inside numbers"> ]?
}

Expand Down
4 changes: 4 additions & 0 deletions src/core/Exception.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1048,6 +1048,10 @@ my class X::Syntax::Number::RadixOutOfRange does X::Syntax {
method message() { "Radix $.radix out of range (allowed: 2..36)" }
}

my class X::Syntax::Number::IllegalDecimal does X::Syntax {
method message() { "Decimal point must be followed by digit" }
}

my class X::Syntax::NonAssociative does X::Syntax {
has $.left;
has $.right;
Expand Down

0 comments on commit 816dd64

Please sign in to comment.