summaryrefslogtreecommitdiff
path: root/tool/enc-unicode.rb
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-10-29 01:03:21 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-10-29 01:03:21 +0000
commitf85b841a012bb07e4b5b22a792974d7d929a091d (patch)
tree5b132485d90a782f98ffd1cd03e961d428c75266 /tool/enc-unicode.rb
parent84b86f106f22e8a719541b92842acde1cea59294 (diff)
* tool/enc-unicode.rb,
enc/unicode/name2ctype.h, enc/unicode/name2ctype.h.blt, enc/unicode/name2ctype.kwd, enc/unicode/name2ctype.src: Add 'Unknown' Script. patched by Run Paint Run Run. [ruby-core:32937] #3998 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29626 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool/enc-unicode.rb')
-rwxr-xr-xtool/enc-unicode.rb10
1 files changed, 7 insertions, 3 deletions
diff --git a/tool/enc-unicode.rb b/tool/enc-unicode.rb
index 49729ec..af70a71 100755
--- a/tool/enc-unicode.rb
+++ b/tool/enc-unicode.rb
@@ -129,13 +129,13 @@ def parse_scripts(data)
]
current = nil
cps = []
- names = []
+ names = {}
files.each do |file|
IO.foreach(get_file(file[:fn])) do |line|
if /^# Total code points: / =~ line
data[current] = cps
make_const(current, cps, file[:title])
- names << current
+ (names[file[:title]] ||= []) << current
cps = []
elsif /^(\h+)(?:..(\h+))?\s*;\s*(\w+)/ =~ line
current = $3
@@ -143,7 +143,11 @@ def parse_scripts(data)
end
end
end
- names
+ # All code points not explicitly listed for Script
+ # have the value Unknown (Zzzz).
+ data['Unknown'] = (0..0x10ffff).to_a - data.values_at(*names['Script']).flatten
+ make_const('Unknown', data['Unknown'], 'Script')
+ names.values.flatten << 'Unknown'
end
def parse_aliases(data)