Skip to content

Commit

Permalink
Implement \U00000 syntax handling for Unicodable
Browse files Browse the repository at this point in the history
Fixes #234
  • Loading branch information
zoffixznet committed Jun 1, 2018
1 parent f579dbd commit 8e73aec
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion bin/Unicodable.p6
Expand Up @@ -96,7 +96,7 @@ method from-numerics($query) {
$query ~~ m:ignoremark/^
:i \s*
[
[ | ‘u’ (.) <?{ $0[*-1].Str.uniname.match: /PLUS.*SIGN/ }>
[ | [「\U」 |‘u’ (.)] <?{ $0[*-1].Str.uniname.match: /PLUS.*SIGN/ }>
| [ <:Nd> & <:Numeric_Value(0)> ] ‘x’ # TODO is it fixed now? … What exactly?
]
$<digit>=<:HexDigit>+
Expand Down
8 changes: 8 additions & 0 deletions t/unicodable.t
Expand Up @@ -217,6 +217,14 @@ $t.test(‘last basic query, just in case’,
/^ <me($t)>‘, U+2A34 MULTIPLICATION SIGN IN LEFT HALF CIRCLE [Sm] (⨴)’ $/,
/^ <me($t)>‘, U+1D227 GREEK INSTRUMENTAL NOTATION SYMBOL-17 [So] (𝈧)’ $/);

# https://github.com/perl6/whateverable/issues/234
$t.test(\U lookup by code,
{$t.bot-nick}: \\U0010ffff,
/^ <me($t)>‘U+10FFFF <illegal> [] (�)’ $/);
$t.test(\U lookup by code,
{$t.bot-nick}: \\U2665,
/^ <me($t)>‘U+2665 BLACK HEART SUIT [So] (♥)’ $/);


$t.last-test;
done-testing;
Expand Down

0 comments on commit 8e73aec

Please sign in to comment.