summaryrefslogtreecommitdiff
path: root/tool/enc-unicode.rb
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-12-01 13:50:13 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-12-01 13:50:13 +0000
commit31796f17d3bd887324100de27014057e99694602 (patch)
tree5ff1f2edc21d1c67755a668f78ce10dfbaf020db /tool/enc-unicode.rb
parent5bf3657b9f06761a61d2b05e8c1e2904660d10b1 (diff)
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
Diffstat (limited to 'tool/enc-unicode.rb')
-rwxr-xr-xtool/enc-unicode.rb21
1 files changed, 12 insertions, 9 deletions
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