summaryrefslogtreecommitdiff
path: root/tool/transcode-tblgen.rb
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-05 22:47:44 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-05 22:47:44 +0000
commite90dd02529bbaa35890750722ecb0d716c2f698b (patch)
treeaedb7dc41f327f53a4b99733fea0c740b0df65eb /tool/transcode-tblgen.rb
parent3af2559d17bbd5b77689440d2e54c905c6cd91aa (diff)
* tool/transcode-tblgen.rb: show generating tables in verbose mode.
(transcode_generate_node): call ActionMap#generate_node with showing table name. * enc/trans/utf_16_32.erb.c: use transcode_generate_node. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18382 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool/transcode-tblgen.rb')
-rw-r--r--tool/transcode-tblgen.rb16
1 files changed, 12 insertions, 4 deletions
diff --git a/tool/transcode-tblgen.rb b/tool/transcode-tblgen.rb
index 9ef21babe09..b42885eacbf 100644
--- a/tool/transcode-tblgen.rb
+++ b/tool/transcode-tblgen.rb
@@ -380,6 +380,7 @@ end
TRANSCODERS = []
def transcode_tblgen(from, to, map)
+ STDERR.puts "converter for #{from} to #{to}" if VERBOSE_MODE
id_from = from.tr('^0-9A-Za-z', '_')
id_to = to.tr('^0-9A-Za-z', '_')
if from == "UTF-8"
@@ -405,6 +406,11 @@ End
tree_code + "\n" + transcoder_code
end
+def transcode_generate_node(am, code, name_hint=nil, ranges=[])
+ STDERR.puts "converter for #{name_hint}" if VERBOSE_MODE
+ am.generate_node(code, name_hint, ranges)
+end
+
def transcode_register_code
code = ''
TRANSCODERS.each {|transcoder_name|
@@ -499,6 +505,8 @@ op.def_option("--force", "force table generation") { force_mode = true }
op.def_option("--output=FILE", "specify output file") {|arg| output_filename = arg }
op.parse!
+VERBOSE_MODE = verbose_mode
+
arg = ARGV.shift
dir = File.dirname(arg)
$:.unshift dir unless $:.include? dir
@@ -523,14 +531,14 @@ if !force_mode && output_filename && File.readable?(output_filename)
if old_signature == chk_signature
now = Time.now
File.utime(now, now, output_filename)
- STDERR.puts "#{output_filename} is already up-to-date." if verbose_mode
+ STDERR.puts "already up-to-date: #{output_filename}" if VERBOSE_MODE
exit
end
end
-if verbose_mode
+if VERBOSE_MODE
if output_filename
- STDERR.print "generate #{output_filename} ..."
+ STDERR.puts "generating #{output_filename} ..."
end
end
@@ -559,7 +567,7 @@ if output_filename
new_filename = output_filename + ".new"
File.open(new_filename, "w") {|f| f << result }
File.rename(new_filename, output_filename)
- STDERR.puts " done." if verbose_mode
+ STDERR.puts "done." if VERBOSE_MODE
else
print result
end