X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/e81df0ef9f0d7b5d22b0829f0a89a380a8e310ab..e41fa43a164e0932a2f8fe9efa5ff6f74b6b7de0:/tools/mkdigraphlist diff --git a/tools/mkdigraphlist b/tools/mkdigraphlist index 4af3590..0714a2b 100755 --- a/tools/mkdigraphlist +++ b/tools/mkdigraphlist @@ -5,7 +5,6 @@ use warnings; use utf8; use open OUT => ':utf8', ':std'; -use Data::Dumper; our $VERSION = '1.03'; @@ -16,7 +15,9 @@ my $di = do 'data/digraphs-rfc.inc.pl' # personal addendums my $extra = do 'data/digraphs-shiar.inc.pl' or warn "could not include shiar proposals: ", $@ // $!; -$di = { %{$di}, %{$extra // {}} }; +my $vim = do 'data/digraphs-vim.inc.pl' + or warn "could not include vim extensions ", $@ // $!; +$di = { %{$vim // {}}, %{$di}, %{$extra // {}} }; # optionally get unicode character information my $uninfo = do 'unicode-char.inc.pl' @@ -35,6 +36,7 @@ print "# automatically generated by $0\n"; print "use utf8;\n"; print "+{\n"; printf '(map {$_=>0} qw{%s}),'."\n", join(' ', + grep { !defined $di->{$_} } map { substr($_, 1, 1).substr($_, 0, 1) } sort keys %{$di} ); printf "q{%s}=>[%s],\n", $_, join(',', @@ -56,11 +58,8 @@ mkdigraphlist - Output character list of combined digraph data =head1 DESCRIPTION -Parses the official RFC-1345 document, searching the -'character mnemonic table' for all digraph definitions. -If successful, Perl code is output resulting in a hash -with character data keyed by digraph. -Any errors and warnings are given at STDERR. +Combines precompiled digraph includes of rfc (1345), vim, and shiar +and outputs a complete map including character details and usage classes. The value can either be a scalar string containing another digraph which can be considered identical (usually inverted),