summaryrefslogtreecommitdiffstats
path: root/tool
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-01 05:54:36 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-01 05:54:36 +0000
commitc61e9f856fd8e45478be5717b35c5d043275e2bc (patch)
tree19a7abbab2e6849d5ffd64f70d09f5fa9330c0c0 /tool
parenta84245a5c7867b3666a34d2ac4a8c7e33c72d94e (diff)
downloadruby-c61e9f856fd8e45478be5717b35c5d043275e2bc.tar.gz
ruby-c61e9f856fd8e45478be5717b35c5d043275e2bc.tar.xz
ruby-c61e9f856fd8e45478be5717b35c5d043275e2bc.zip
* tool/transcode-tblgen.rb (transcode_compile_tree): use the first
mapping when some mappings are given for a character. [ruby-dev:36068] * tool/transcode-tblgen.rb: expandtab. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19018 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool')
-rw-r--r--tool/transcode-tblgen.rb44
1 files changed, 22 insertions, 22 deletions
diff --git a/tool/transcode-tblgen.rb b/tool/transcode-tblgen.rb
index aaf33bee6..fe84703ce 100644
--- a/tool/transcode-tblgen.rb
+++ b/tool/transcode-tblgen.rb
@@ -479,29 +479,29 @@ def citrus_decode_mapsrc(ces, csid, mapsrcs)
STDERR.puts 'load mapsrc %s' % path if VERBOSE_MODE
open(path) do |f|
f.each_line do |l|
- break if /^BEGIN_MAP/ =~ l
+ break if /^BEGIN_MAP/ =~ l
end
f.each_line do |l|
- next if /^\s*(?:#|$)/ =~ l
- break if /^END_MAP/ =~ l
- case mode
- when :from_ucs
- case l
- when /0x(\w+)\s*-\s*0x(\w+)\s*=\s*INVALID/
- # table.push << ["{#$1-#$2}", :invalid]
- when /(0x\w+)\s*=\s*(0x\w+)/
- table.push << [$1.hex, citrus_cstomb(ces, csid, $2.hex)]
- else
- raise "unknown notation '%s'"% l
- end
- when :to_ucs
- case l
- when /(0x\w+)\s*=\s*(0x\w+)/
- table.push << [citrus_cstomb(ces, csid, $1.hex), $2.hex]
- else
- raise "unknown notation '%s'"% l
- end
- end
+ next if /^\s*(?:#|$)/ =~ l
+ break if /^END_MAP/ =~ l
+ case mode
+ when :from_ucs
+ case l
+ when /0x(\w+)\s*-\s*0x(\w+)\s*=\s*INVALID/
+ # Citrus OOB_MODE
+ when /(0x\w+)\s*=\s*(0x\w+)/
+ table.push << [$1.hex, citrus_cstomb(ces, csid, $2.hex)]
+ else
+ raise "unknown notation '%s'"% l
+ end
+ when :to_ucs
+ case l
+ when /(0x\w+)\s*=\s*(0x\w+)/
+ table.push << [citrus_cstomb(ces, csid, $1.hex), $2.hex]
+ else
+ raise "unknown notation '%s'"% l
+ end
+ end
end
end
end
@@ -523,7 +523,7 @@ def transcode_compile_tree(name, from, map)
map = encode_utf8(map)
h = {}
map.each {|k, v|
- h[k] = v
+ h[k] = v unless h[k] # use first mapping
}
am = ActionMap.parse(h)