aboutsummaryrefslogtreecommitdiff
path: root/baserefresh.pl
diff options
context:
space:
mode:
authorMark E. Shoulson <mark@kli.org>2020-06-01 12:57:29 -0400
committerMark E. Shoulson <mark@kli.org>2021-07-20 15:13:38 -0400
commitcccfd0dd236586e9ad1f28b62dde6e417cb9bc69 (patch)
treea3350ac170c7f7ce41d4777747e118e83317d9ce /baserefresh.pl
parentMerge branch 'master' (diff)
parentA bunch more emoji, including some new ones. (diff)
downloaddotXCompose-cccfd0dd236586e9ad1f28b62dde6e417cb9bc69.tar.gz
dotXCompose-cccfd0dd236586e9ad1f28b62dde6e417cb9bc69.tar.bz2
dotXCompose-cccfd0dd236586e9ad1f28b62dde6e417cb9bc69.zip
Merge branch 'master'
Diffstat (limited to 'baserefresh.pl')
-rw-r--r--baserefresh.pl27
1 files changed, 27 insertions, 0 deletions
diff --git a/baserefresh.pl b/baserefresh.pl
new file mode 100644
index 0000000..f684569
--- /dev/null
+++ b/baserefresh.pl
@@ -0,0 +1,27 @@
+#!/usr/bin/perl -n
+my $last;
+
+# The whole "base" file format took shape kind of sloppily, just getting a
+# list of likely-looking characters and all, which is why it's sort of a
+# mess. It also didn't really have good ways of updating it with new
+# emoji. This file is _part_ of such a solution: it takes in a "base" file
+# and adds the "<MM>" line after just those "#-" lines which are not
+# followed by a line that starts with "##" or with NO #-signs.
+
+BEGIN {binmode(STDOUT, ":utf8");
+ binmode(STDIN, ":utf8");
+}
+
+while (/^#- /) {
+ $last = $_;
+ print;
+ $_ = <>;
+ if (/^[^#]/ or /^##/) {
+ last;
+ }
+ $last = substr($last, 3);
+ @_ = split /;/, $last;
+ printf qq(<MM> \{%s\} : "%s" U%s\t# %s\n), lc($_[1]),chr(hex($_[0])), $_[0], $_[1];
+}
+print;
+