X-Git-Url: http://git.shiar.net/sheet.git/blobdiff_plain/3428231ed210aaeeb9c4372fca180e78a6034dc5..71ebec1cf2c6050f2b92f4b46bc1f59b45414fb7:/tools/mkcharver diff --git a/tools/mkcharver b/tools/mkcharver new file mode 100755 index 0000000..f8fc3e8 --- /dev/null +++ b/tools/mkcharver @@ -0,0 +1,43 @@ +#!/usr/bin/env perl +use 5.012; +use warnings; +use utf8; + +our $VERSION = '1.00'; + +say '# automatically generated by tools/mkcharver'; +say '+{'; + +while (my $line = readline) { + $line =~ m{ + \A (? [0-9A-F]+) + (?: \.\. (? [0-9A-F]+) )? + \h+ ; \h+ (? [0-9]+) \. (? [0-9]) + }x or next; + + my $start = hex $+{start}; + my $end = defined $+{end} ? hex $+{end} : $start; + my $version = $+{major} . $+{minor}; + say "(map {\$_ => $version} $start .. $end),"; +} + +say '}'; + +__END__ + +=head1 NAME + +mkcharver - Create Perl include of Unicode character versions + +=head1 SYNOPSIS + + mkcharver DerivedAge.txt >unicode-age.inc.pl + +=head1 AUTHOR + +Mischa POSLAWSKY + +=head1 LICENSE + +Licensed under the GNU Affero General Public License version 3. +