digraphs: mkdigraphlist: avoid undefinedness warnings
authorMischa POSLAWSKY <perl@shiar.org>
Sun, 22 Feb 2015 15:16:43 +0000 (16:16 +0100)
committerMischa POSLAWSKY <perl@shiar.org>
Tue, 9 Jun 2015 03:43:42 +0000 (05:43 +0200)
digraphs.plp
tools/mkdigraphlist

index 18123a61e127c8640681152c3ad25231f78f4eb0..84ac97133fccb16f8e7e3b122e830e604d1b1586 100644 (file)
@@ -23,7 +23,8 @@ Also see <a href="/unicode">common digraphs</a>.</p>
 are available as <a href="/digraphs.vim">ex commands</a>.</p>
 
 <:
 are available as <a href="/digraphs.vim">ex commands</a>.</p>
 
 <:
-my $di = do 'digraphs.inc.pl';
+my $di = do 'digraphs.inc.pl'
+       or die "Error loading digraphs data: ", $@ // $!;
 
 my @chars = (
        [qw{! " % ' ( ) * + , - . /}],
 
 my @chars = (
        [qw{! " % ' ( ) * + , - . /}],
index ecd825f0d653cc8c7fd32bd90bfc45ee970f60b5..500abbb0f6438fa7748f94808eb25fce5f75fbb6 100755 (executable)
@@ -33,11 +33,11 @@ printf '(map {$_=>0} qw{%s}),'."\n", join(' ',
 printf "q{%s}=>[%s],\n", s/(?=[\\}])/\\/gr, join(',',
        ord $di->{$_},   # original code point
        map {"'$_'"}
 printf "q{%s}=>[%s],\n", s/(?=[\\}])/\\/gr, join(',',
        ord $di->{$_},   # original code point
        map {"'$_'"}
-       $uninfo->{ $di->{$_} }->[1],  # name
+       $uninfo->{ $di->{$_} }->[1] // '',  # name
        $vim->{$_}
                ? $rfc->{$_} ? 'u-di' : 'u-prop'  # vim+rfc or vim-only
                :              'u-prop ex',  # neither
        $vim->{$_}
                ? $rfc->{$_} ? 'u-di' : 'u-prop'  # vim+rfc or vim-only
                :              'u-prop ex',  # neither
-       $uninfo->{ $di->{$_} }->[0] =~ s/ u-di| u-prop| ex//gr,  # class
+       ($uninfo->{ $di->{$_} }->[0] // '') =~ s/ u-di| u-prop| ex//gr,  # class
        $uninfo->{ $di->{$_} }->[4] // (),  # string
 ) for sort keys %{$di};
 print "}\n";
        $uninfo->{ $di->{$_} }->[4] // (),  # string
 ) for sort keys %{$di};
 print "}\n";