Skip to content

Commit 8e73aec

Browse files
committed
Implement \U00000 syntax handling for Unicodable
Fixes #234
1 parent f579dbd commit 8e73aec

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

bin/Unicodable.p6

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ method from-numerics($query) {
9696
$query ~~ m:ignoremark/^
9797
:i \s*
9898
[
99-
[ | ‘u’ (.) <?{ $0[*-1].Str.uniname.match: /PLUS.*SIGN/ }>
99+
[ | [「\U」 |‘u’ (.)] <?{ $0[*-1].Str.uniname.match: /PLUS.*SIGN/ }>
100100
| [ <:Nd> & <:Numeric_Value(0)> ] ‘x’ # TODO is it fixed now? … What exactly?
101101
]
102102
$<digit>=<:HexDigit>+

t/unicodable.t

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,14 @@ $t.test(‘last basic query, just in case’,
217217
/^ <me($t)>‘, U+2A34 MULTIPLICATION SIGN IN LEFT HALF CIRCLE [Sm] (⨴)’ $/,
218218
/^ <me($t)>‘, U+1D227 GREEK INSTRUMENTAL NOTATION SYMBOL-17 [So] (𝈧)’ $/);
219219

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

221229
$t.last-test;
222230
done-testing;

0 commit comments

Comments
 (0)