summaryrefslogtreecommitdiff
path: root/tool
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-10-05 13:27:48 (GMT)
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-10-05 13:27:48 (GMT)
commit805c20a8e59315f15dbb22ac1518de6a27385039 (patch)
tree81b4d726b3ee9e06afa2f0781dfbad263c62dbff /tool
parentfab171e541f7b7373efe386ae956d7a44ce4e330 (diff)
* lib/pp.rb: Use frozen_string_literal: true.
* lib/prettyprint.rb: Ditto. * lib/resolv.rb: Ditto. * lib/tmpdir.rb: Ditto. * test/test_pp.rb: Ditto. * test/test_prettyprint.rb: Ditto. * tool/transcode-tblgen.rb: Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52042 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool')
-rw-r--r--tool/transcode-tblgen.rb16
1 files changed, 9 insertions, 7 deletions
diff --git a/tool/transcode-tblgen.rb b/tool/transcode-tblgen.rb
index 832d9a4..569f802 100644
--- a/tool/transcode-tblgen.rb
+++ b/tool/transcode-tblgen.rb
@@ -1,3 +1,5 @@
+# -*- frozen_string_literal: true -*-
+
require 'optparse'
require 'erb'
require 'fileutils'
@@ -53,7 +55,7 @@ class ArrayCode
@type = type
@name = name
@len = 0;
- @content = ''
+ @content = ''.dup
end
def length
@@ -517,7 +519,7 @@ class ActionMap
infos = infos.map {|info| generate_info(info) }
maxlen = infos.map {|info| info.length }.max
columns = maxlen <= 16 ? 4 : 2
- code = ""
+ code = "".dup
0.step(infos.length-1, columns) {|i|
code << " "
is = infos[i,columns]
@@ -817,7 +819,7 @@ def transcode_compile_tree(name, from, map, valid_encoding)
end
TRANSCODERS = []
-TRANSCODE_GENERATED_TRANSCODER_CODE = ''
+TRANSCODE_GENERATED_TRANSCODER_CODE = ''.dup
def transcode_tbl_only(from, to, map, valid_encoding=UnspecifiedValidEncoding)
if VERBOSE_MODE
@@ -881,7 +883,7 @@ def transcode_generated_code
end
def transcode_register_code
- code = ''
+ code = ''.dup
TRANSCODERS.each {|transcoder_name|
code << " rb_register_transcoder(&#{transcoder_name});\n"
}
@@ -1006,7 +1008,7 @@ if __FILE__ == $0
this_script = File.read(__FILE__)
this_script.force_encoding("ascii-8bit") if this_script.respond_to? :force_encoding
- base_signature = "/* autogenerated. */\n"
+ base_signature = "/* autogenerated. */\n".dup
base_signature << "/* #{make_signature(File.basename(__FILE__), this_script)} */\n"
base_signature << "/* #{make_signature(File.basename(arg), src)} */\n"
@@ -1044,7 +1046,7 @@ if __FILE__ == $0
libs2 = $".dup
libs = libs2 - libs1
- lib_sigs = ''
+ lib_sigs = ''.dup
libs.each {|lib|
lib = File.basename(lib)
path = File.join($srcdir, lib)
@@ -1053,7 +1055,7 @@ if __FILE__ == $0
end
}
- result = ''
+ result = ''.dup
result << base_signature
result << lib_sigs
result << "\n"