-
-
Save MasterDuke17/e14fe534c3d348c975da200a98abdbb9 to your computer and use it in GitHub Desktop.
find all Nd chars
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my %h; | |
for ^0xFFFF { | |
if .chr.uniprop eq 'Nd' { | |
%h{.unival}.push: $_ | |
} | |
elsif $_ >= 'a'.ord && $_ <= 'z'.ord { | |
%h{$_ - 'a'.ord + 10}.push: $_ | |
} | |
elsif $_ >= 'A'.ord && $_ <= 'Z'.ord { | |
%h{$_ - 'A'.ord + 10}.push: $_ | |
} | |
elsif $_ >= 0xFF21 && $_ <= 0xFF3A { | |
%h{$_ - 0xFF21 + 10}.push: $_ | |
} | |
elsif $_ >= 0xFF41 && $_ <= 0xFF5A { | |
%h{$_ - 0xFF41 + 10}.push: $_ | |
} | |
} | |
for %h.keys.sort(+*) -> $val { | |
for @(%h{$val}) -> $char { | |
say "case $char:"; | |
} | |
say " ch = $val;\n break;" | |
} | |
say "default:\n goto END_WHILE" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment