summaryrefslogtreecommitdiff
path: root/tool
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-09-22 20:39:35 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-09-22 20:39:35 (GMT)
commit04a353fe023a7086f0bb8b68d38d2f267dbc21da (patch)
tree78de8b4cd1ba152920d9c5a5158712739a152004 /tool
parent450107efe48f86238043a9533e244f0f2143b353 (diff)
tool/enc-unicode.rb: rewrote without flip-flop
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64814 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool')
-rwxr-xr-xtool/enc-unicode.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/tool/enc-unicode.rb b/tool/enc-unicode.rb
index d953014..c5c593f 100755
--- a/tool/enc-unicode.rb
+++ b/tool/enc-unicode.rb
@@ -535,6 +535,7 @@ if header
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
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