digraphs: parse recent plan9 character additions
authorMischa POSLAWSKY <perl@shiar.org>
Sun, 7 Nov 2021 00:41:07 +0000 (01:41 +0100)
committerMischa POSLAWSKY <perl@shiar.org>
Tue, 9 Nov 2021 03:14:15 +0000 (04:14 +0100)
Fix syntax warnings for 2020-05-19 change in upstream repository to support
higher-plane unicode references.  Record download rule for future validation.

Makefile
tools/mkdigraphs-plan9

index 961f4727909bf76b2b6aef6c113e9f98fde4f956..e635f5fc4bf2396b7856a8e85c0a0e5e2665bc27 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -44,13 +44,17 @@ data/digraphs-shiar.inc.pl: tools/mkdigraphs-shiar shiar.inc.txt
 
 data/xorg-compose: $(download)
        tools/wget-ifmodified http://cgit.freedesktop.org/xorg/lib/libX11/plain/nls/en_US.UTF-8/Compose.pre $@
-
 data/digraphs-xorg.inc.pl: tools/mkdigraphs-xorg data/xorg-compose
        $(call cmdsave,$^)
 
 data/digraphs-vim.inc.pl: tools/mkdigraphs-vim
        $(call cmdsave,$<)
 
+data/digraphs-plan9.txt:
+       tools/wget-ifmodified https://9fans.github.io/usr/local/plan9/lib/keyboard $@
+data/digraphs-plan9.inc.pl: tools/mkdigraphs-plan9 data/digraphs-plan9.txt
+       $(call cmdsave,$^)
+
 data/digraphs.inc.pl: tools/mkdigraphlist data/digraphs-rfc.inc.pl data/digraphs-vim.inc.pl data/digraphs-shiar.inc.pl data/unicode-char.inc.pl
        $(call cmdsave,$<)
 
index 54b8b3c059aa57a8587a4ad33b4d25a6a9b27008..31bab3c6494fd78f21da19b68b54d63a4c96333a 100755 (executable)
@@ -5,7 +5,7 @@ use utf8;
 use open IO => ':utf8', ':std';
 use Data::Dump 'pp';
 
-our $VERSION = '1.00';
+our $VERSION = '1.01';
 
 # translation table for deprecated code points
 my %replace = (
@@ -23,8 +23,9 @@ say "# automatically generated by $0";
 say 'use utf8;';
 say '+{';
 while ($_ = readline) {
-       my ($chrhex, $mnems, $sample, $name) = m{\A([0-9A-F]{4})  (.{11}) (.)\t(.*)}i
+       my ($chrhex, $mnems, $sample, $name) = m{\A([0-9A-F ]{5}) (.{11}) (.)\h(.*)}i
                or warn("syntax error on line $.: $_"), next;
+       $chrhex =~ s/ $//;
        my $chrnum = hex $chrhex;
        my $chr = chr $chrnum;
        $chr eq $sample