summaryrefslogtreecommitdiff
path: root/template/transdb.h.tmpl
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-06-15 08:53:17 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-06-15 08:53:17 +0000
commit301fa452f7a9cdea922103e9c50d85a2d5652d0d (patch)
treeb503ea3e71639ed59dacf26a134710cb4ca757ea /template/transdb.h.tmpl
parentbf7a32d22079cc44eb19794e41d82b886d5d17b3 (diff)
Remove flip-flop usages from build scripts
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63669 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'template/transdb.h.tmpl')
-rw-r--r--template/transdb.h.tmpl21
1 files changed, 11 insertions, 10 deletions
diff --git a/template/transdb.h.tmpl b/template/transdb.h.tmpl
index d0cf101344..16565dd638 100644
--- a/template/transdb.h.tmpl
+++ b/template/transdb.h.tmpl
@@ -36,17 +36,18 @@ transdirs.each do |transdir|
files[fn] = true
path = File.join(transdir,fn)
open(path) do |f|
+ transcoder_def = false
f.each_line do |line|
- if (/^static const rb_transcoder/ =~ line)..(/"(.*?)"\s*,\s*"(.*?)"/ =~ line)
- if $1 && $2
- from_to = "%s to %s" % [$1, $2]
- if converters[from_to]
- raise ArgumentError, '%s:%d: transcode "%s" is already registered at %s:%d' %
- [path, $., from_to, *converters[from_to].values_at(3, 4)]
- else
- converters[from_to] = [$1, $2, fn[0..-3], path, $.]
- converter_list << from_to
- end
+ transcoder_def = true if /^static const rb_transcoder/ =~ line
+ if transcoder_def && /"(.*?)"\s*,\s*"(.*?)"/ =~ line
+ transcoder_def = false
+ from_to = "%s to %s" % [$1, $2]
+ if converters[from_to]
+ raise ArgumentError, '%s:%d: transcode "%s" is already registered at %s:%d' %
+ [path, $., from_to, *converters[from_to].values_at(3, 4)]
+ else
+ converters[from_to] = [$1, $2, fn[0..-3], path, $.]
+ converter_list << from_to
end
end
end