ruby-changes:52602
From: nobu <ko1@a...>
Date: Sun, 23 Sep 2018 05:39:41 +0900 (JST)
Subject: [ruby-changes:52602] nobu:r64814 (trunk): tool/enc-unicode.rb: rewrote without flip-flop
nobu 2018-09-23 05:39:35 +0900 (Sun, 23 Sep 2018) New Revision: 64814 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=64814 Log: tool/enc-unicode.rb: rewrote without flip-flop Modified files: trunk/tool/enc-unicode.rb Index: tool/enc-unicode.rb =================================================================== --- tool/enc-unicode.rb (revision 64813) +++ tool/enc-unicode.rb (revision 64814) @@ -535,6 +535,7 @@ if header https://github.com/ruby/ruby/blob/trunk/tool/enc-unicode.rb#L535 IO.popen([*NAME2CTYPE, out: tmp], "w") {|f| output.show(f, *syms)} end while syms.pop fds.each(&:close) + ff = nil IO.popen(%W[diff -DUSE_UNICODE_AGE_PROPERTIES #{fds[1].path} #{fds[0].path}], "r") {|age| IO.popen(%W[diff -DUSE_UNICODE_PROPERTIES #{fds[2].path} -], "r", in: age) {|f| ansi = false @@ -545,7 +546,7 @@ if header https://github.com/ruby/ruby/blob/trunk/tool/enc-unicode.rb#L546 line.sub!(/\/\*ANSI\*\//, '1') if ansi line.gsub!(/\(int\)\((?:long|size_t)\)&\(\(struct uniname2ctype_pool_t \*\)0\)->uniname2ctype_pool_(str\d+),\s+/, 'uniname2ctype_offset(\1), ') - if (/^(uniname2ctype_hash) /=~line)..(/^\}/=~line) + if ff = (!ff ? /^(uniname2ctype_hash) /=~line : /^\}/!~line) # no line can match both, exclusive flip-flop line.sub!(/^( *(?:register\s+)?(.*\S)\s+hval\s*=\s*)(?=len;)/, '\1(\2)') end puts line -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/