digraphs: allow proposals by decimal code point escape
authorMischa POSLAWSKY <perl@shiar.org>
Sun, 29 Mar 2015 18:24:10 +0000 (20:24 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Tue, 9 Jun 2015 03:43:44 +0000 (05:43 +0200)
shiar.inc.txt
tools/mkdigraphs-shiar

index 30f81b8b76f6b9e8caac538466804ccee31a2544..2b2abd0d07f4f751793145a617a7be96b3fe4ce2 100644 (file)
@@ -635,11 +635,11 @@ EK ㅖ
 0A ٠
 
 # common formatting control
-ZS   # ZWSP; capitals like other Cc
-ZN   # ZWNJ;                           less obvious alt: 'Z
-ZW   # ZWJ; ZJ somewhy used for tsadi; less obvious alt: "Z
-LR   # LRM
-RL   # RLM; keep rl for ɼ
+ZS \8203  # ZWSP; capitals like other Cc
+ZN \8204  # ZWNJ;                           less obvious alt: 'Z
+ZW \8205  # ZWJ; ZJ somewhy used for tsadi; less obvious alt: "Z
+LR \8206  # LRM
+RL \8207  # RLM; keep rl for ɼ
 
 ###
 # under development or temporary
index 05399b0aecb12fa911f952f3566173a918452e85..443de5d025d71d04478c82920973fb7713f91646 100755 (executable)
@@ -4,7 +4,7 @@ use strict;
 use warnings;
 use open IN => ':utf8', ':std';
 
-our $VERSION = '1.01';
+our $VERSION = '1.02';
 
 my $di = do "data/digraphs-rfc.inc.pl"
        or warn "official digraphs not included for comparison: ", $@ // $!;
@@ -12,9 +12,9 @@ my $di = do "data/digraphs-rfc.inc.pl"
 say "# automatically generated by $0";
 say '+{';
 for (readline) {
-       my ($mnem, $chr) = m{^([!"%'-Z_a-z]{2}) (.)} or next;
+       my ($mnem, $cp, $chr) = m{^([!"%'-Z_a-z]{2}) (?:(\\\d+)|(.))} or next;
        warn("$mnem already defined"), next if defined $di->{$mnem};
-       my $chrstr = sprintf '"\x{%x}"', ord $chr;
+       my $chrstr = sprintf '"\x{%x}"', $cp // ord $chr;
        say "q{$mnem} => $chrstr,";
 }
 say '}';