countries: reserve cq and describe user-assigned codes
[sheet.git] / tools / mkcharinfo
index da6aa87d5644d90a273e3ff5b89c86c9ade48832..8f762fad6d2fc06d921750b216bb2267b12cf634 100755 (executable)
@@ -2,7 +2,6 @@
 use 5.014;
 use warnings;
 use utf8;
-no if $] >= 5.018, warnings => 'experimental::smartmatch';
 use lib '.';
 
 use open OUT => ':encoding(utf-8)', ':std';
@@ -38,11 +37,15 @@ eval {
        1;
 } or warn "Failed reading unicode tables: $@";
 
-eval {
-       my $kbd = do './keyboard/altgr/macos-abc.eng.inc.pl' or die $@ || $!;
-       $info{$_} //= {} for map {s/◌//g; m/\A./g} values %{ $kbd->{key} };
-       1;
-} or warn "Failed reading additional keyboard map: $@";
+for my $layout ('macos-abc', 'windows') {
+       eval {
+               my $kbd = do "./keyboard/altgr/$layout.eng.inc.pl" or die $@ || $!;
+               my @def = map { values %{$_} } values %{ $kbd->{def} }
+                       or die 'missing key definitions';
+               $info{$_} //= {} for map {s/◌//g; m/\A./g} map { $_->[1] // () } @def;
+               1;
+       } or warn "Failed reading additional keyboard map $layout: $@";
+}
 
 eval {
        require HTML::Entities;