mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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: svn+ssh://ci.ruby-lang.org/ruby/trunk@19018 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
d7cffe9768
commit
7ae5e9c960
2 changed files with 30 additions and 22 deletions
|
@ -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>
|
Mon Sep 1 14:40:18 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
|
||||||
|
|
||||||
* README.EXT (Appendix A): fixed the name of class
|
* README.EXT (Appendix A): fixed the name of class
|
||||||
|
|
|
@ -479,29 +479,29 @@ def citrus_decode_mapsrc(ces, csid, mapsrcs)
|
||||||
STDERR.puts 'load mapsrc %s' % path if VERBOSE_MODE
|
STDERR.puts 'load mapsrc %s' % path if VERBOSE_MODE
|
||||||
open(path) do |f|
|
open(path) do |f|
|
||||||
f.each_line do |l|
|
f.each_line do |l|
|
||||||
break if /^BEGIN_MAP/ =~ l
|
break if /^BEGIN_MAP/ =~ l
|
||||||
end
|
end
|
||||||
f.each_line do |l|
|
f.each_line do |l|
|
||||||
next if /^\s*(?:#|$)/ =~ l
|
next if /^\s*(?:#|$)/ =~ l
|
||||||
break if /^END_MAP/ =~ l
|
break if /^END_MAP/ =~ l
|
||||||
case mode
|
case mode
|
||||||
when :from_ucs
|
when :from_ucs
|
||||||
case l
|
case l
|
||||||
when /0x(\w+)\s*-\s*0x(\w+)\s*=\s*INVALID/
|
when /0x(\w+)\s*-\s*0x(\w+)\s*=\s*INVALID/
|
||||||
# table.push << ["{#$1-#$2}", :invalid]
|
# Citrus OOB_MODE
|
||||||
when /(0x\w+)\s*=\s*(0x\w+)/
|
when /(0x\w+)\s*=\s*(0x\w+)/
|
||||||
table.push << [$1.hex, citrus_cstomb(ces, csid, $2.hex)]
|
table.push << [$1.hex, citrus_cstomb(ces, csid, $2.hex)]
|
||||||
else
|
else
|
||||||
raise "unknown notation '%s'"% l
|
raise "unknown notation '%s'"% l
|
||||||
end
|
end
|
||||||
when :to_ucs
|
when :to_ucs
|
||||||
case l
|
case l
|
||||||
when /(0x\w+)\s*=\s*(0x\w+)/
|
when /(0x\w+)\s*=\s*(0x\w+)/
|
||||||
table.push << [citrus_cstomb(ces, csid, $1.hex), $2.hex]
|
table.push << [citrus_cstomb(ces, csid, $1.hex), $2.hex]
|
||||||
else
|
else
|
||||||
raise "unknown notation '%s'"% l
|
raise "unknown notation '%s'"% l
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -523,7 +523,7 @@ def transcode_compile_tree(name, from, map)
|
||||||
map = encode_utf8(map)
|
map = encode_utf8(map)
|
||||||
h = {}
|
h = {}
|
||||||
map.each {|k, v|
|
map.each {|k, v|
|
||||||
h[k] = v
|
h[k] = v unless h[k] # use first mapping
|
||||||
}
|
}
|
||||||
am = ActionMap.parse(h)
|
am = ActionMap.parse(h)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue