4 use open IN => ':utf8', ':std';
8 my $di = do "data/digraphs-rfc.inc.pl"
9 or warn "official digraphs not included for comparison: ", $@ // $!;
11 say "# automatically generated by $0";
14 my ($mnem, $cp, $chr) = m{^([!"%'-Z_a-z]{2}) (?:\\(\d+)|(.))} or next;
15 warn("$mnem already defined"), next if defined $di->{$mnem};
16 my $chrstr = sprintf '"\x{%x}"', $cp // ord $chr;
17 say "q{$mnem} => $chrstr,";
25 mkdigraphs-shiar - Output digraph data from proposal text
29 mkdigraphs-shiar shiar.inc.txt >digraphs-shiar.inc.pl
30 perl -e'$di = do "digraphs-shiar.inc.pl"; print chr $di->{":)"}'
34 Parses a text file containing digraphs followed by
35 the literal unicode character and optional comments.
36 If successful, Perl code is output resulting in a hash
37 with Unicode code points keyed by digraph.
38 Any errors and warnings are given at STDERR.
42 Mischa POSLAWSKY <perl@shiar.org>
46 Licensed under the GNU Affero General Public License version 3.