From 31796f17d3bd887324100de27014057e99694602 Mon Sep 17 00:00:00 2001 From: naruse Date: Fri, 1 Dec 2017 13:50:13 +0000 Subject: Update to Onigmo 6.1.3-669ac9997619954c298da971fcfacccf36909d05. [Bug #13892] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60966 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- tool/enc-unicode.rb | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'tool') diff --git a/tool/enc-unicode.rb b/tool/enc-unicode.rb index ed45a30366..d82f1dbdd1 100755 --- a/tool/enc-unicode.rb +++ b/tool/enc-unicode.rb @@ -133,14 +133,15 @@ def parse_scripts(data, categories) files = [ {:fn => 'DerivedCoreProperties.txt', :title => 'Derived Property'}, {:fn => 'Scripts.txt', :title => 'Script'}, - {:fn => 'PropList.txt', :title => 'Binary Property'} + {:fn => 'PropList.txt', :title => 'Binary Property'}, + {:fn => 'emoji-data.txt', :title => 'Emoji'} ] current = nil cps = [] names = {} files.each do |file| data_foreach(file[:fn]) do |line| - if /^# Total code points: / =~ line + if /^# Total (?:code points|elements): / =~ line data[current] = cps categories[current] = file[:title] (names[file[:title]] ||= []) << current @@ -310,13 +311,15 @@ def data_foreach(name, &block) pat = /^# #{File.basename(name).sub(/\./, '-([\\d.]+)\\.')}/ File.open(fn, 'rb') do |f| line = f.gets - unless pat =~ line - raise ArgumentError, "#{name}: no Unicode version" - end - if !$unicode_version - $unicode_version = $1 - elsif $unicode_version != $1 - raise ArgumentError, "#{name}: Unicode version mismatch: #$1" + unless /^emoji-/ =~ name + unless pat =~ line + raise ArgumentError, "#{name}: no Unicode version" + end + if !$unicode_version + $unicode_version = $1 + elsif $unicode_version != $1 + raise ArgumentError, "#{name}: Unicode version mismatch: #$1" + end end f.each(&block) end -- cgit v1.2.3