ruby-changes:7497
From: naruse <ko1@a...>
Date: Mon, 1 Sep 2008 14:54:56 +0900 (JST)
Subject: [ruby-changes:7497] Ruby:r19018 (trunk): * tool/transcode-tblgen.rb (transcode_compile_tree): use the first
naruse 2008-09-01 14:54:36 +0900 (Mon, 01 Sep 2008) New Revision: 19018 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=19018 Log: * 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. Modified files: trunk/ChangeLog trunk/tool/transcode-tblgen.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 19017) +++ ChangeLog (revision 19018) @@ -1,3 +1,11 @@ +Mon Sep 1 14:44:22 2008 NARUSE, Yui <naruse@r...> + + * 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@y...> * README.EXT (Appendix A): fixed the name of class Index: tool/transcode-tblgen.rb =================================================================== --- tool/transcode-tblgen.rb (revision 19017) +++ tool/transcode-tblgen.rb (revision 19018) @@ -479,29 +479,29 @@ 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 @@ 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) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/