summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog8
-rw-r--r--tool/transcode-tblgen.rb44
2 files changed, 30 insertions, 22 deletions
diff --git a/ChangeLog b/ChangeLog
index b205d673db..980663eb7a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Mon Sep 1 14:44:22 2008 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * 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.
+
Mon Sep 1 14:40:18 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
* README.EXT (Appendix A): fixed the name of class
diff --git a/tool/transcode-tblgen.rb b/tool/transcode-tblgen.rb
index aaf33bee6d..fe84703ce6 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)