FWIW, here was my attempt to resolve this issue:

diff --git a/src/Perl6/Grammar.nqp b/src/Perl6/Grammar.nqp
index 13c09feb9..09b05bac7 100644
--- a/src/Perl6/Grammar.nqp
+++ b/src/Perl6/Grammar.nqp
@@ -3553,6 +3553,9 @@ grammar Perl6::Grammar is HLL::Grammar does STD {
| <VALUE=decint>
]
<!!before ['.' <?before \s | ',' | '=' | ':' | <.terminator> | $ >
<.typed_sorry: 'X::Syntax::Number::IllegalDecimal'>]? >
+ [ :my $inv; <?before $<a>=<:L - [ei]> { $inv := $<a> }>
+ <.typed_panic: "X::Syntax::Confused",
+ reason => "Invalid character '$inv' in number literal"> ]?
[ <?before '_' '_'+\d> <.sorry: "Only isolated underscores are allowed inside
numbers"> ]?
}


This made the error message as awesome as it was suggested in the OP. Problem
is, some spectests were failing. Things like :42foo started to complain
needlessly. I guess it's still possible to resolve this ticket, I was simply
doing it wrong.

On 2015-07-24 15:53:57, alex.jakime...@gmail.com wrote:
> Code:
> say 0b000l01;
>
> Result:
> ===SORRY!=== Error while compiling ./test.pl
> Confused
> at ./test.pl:2
> ------> say 0b000⏏l01;
>
> The error message could be better. For example:
> Code:
> say :2<000l01>;
>
> Result:
> ===SORRY!===
> Invalid character 'L' in number literal
>
> It would be great (if it is easy to implement) if it also mentioned that it
> is a hex/binary/octal number (not just a number literal), because some
> people might be unaware of that notation (kid-friendly error messages?).
>
> IRC log: http://irclog.perlgeek.de/perl6/2015-07-24#i_10951220

Reply via email to