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