diff options
author | duerst <duerst@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-09-29 07:54:05 +0000 |
---|---|---|
committer | duerst <duerst@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-09-29 07:54:05 +0000 |
commit | 238d32c23f12b46ebadbfd7870cfcc9d83286b1d (patch) | |
tree | d85a65158ae60ffd251bc1c2a9861c059d9c45b7 /template | |
parent | a9df34cd05d9f88466c52364780f0e40c13a3e45 (diff) | |
download | ruby-238d32c23f12b46ebadbfd7870cfcc9d83286b1d.tar.gz |
tool/unicode_norm_gen.tmpl, lib/unicode_normalize/tables.rb:
get rid of many .freeze commands by using frozen_string_literal
pragma.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51971 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'template')
-rw-r--r-- | template/unicode_norm_gen.tmpl | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/template/unicode_norm_gen.tmpl b/template/unicode_norm_gen.tmpl index 955c858599..f613f0130a 100644 --- a/template/unicode_norm_gen.tmpl +++ b/template/unicode_norm_gen.tmpl @@ -152,17 +152,17 @@ end # generate normalization tables file %># coding: us-ascii +# -*- frozen_string_literal: true %# > # automatically generated by template/unicode_norm_gen.tmpl module UnicodeNormalize - UNICODE_VERSION = "<%=unicode_version%>".freeze + UNICODE_VERSION = "<%=unicode_version%>" accents = "" \ "[<% accent_array.each_regexp_chars do |rx|%><%=rx%>" \ - "<% end%>]" \ - "".freeze + "<% end%>]" ACCENTS = accents REGEXP_D_STRING = "#{'' # composition starters and composition exclusions }" \ @@ -174,8 +174,7 @@ module UnicodeNormalize "<% end%>]?#{accents}+" \ "|#{'' # precomposed Hangul syllables }" \ - "[\u{AC00}-\u{D7A4}]" \ - "".freeze + "[\u{AC00}-\u{D7A4}]" REGEXP_C_STRING = "#{'' # composition exclusions }" \ "[<% composition_exclusions.each_regexp_chars do |rx|%><%=rx%>" \ @@ -190,12 +189,10 @@ module UnicodeNormalize "<% end%>][\u11A8-\u11C2]" \ "|#{'' # decomposed Hangul syllables }" \ - "[\u1100-\u1112][\u1161-\u1175][\u11A8-\u11C2]?" \ - "".freeze + "[\u1100-\u1112][\u1161-\u1175][\u11A8-\u11C2]?" REGEXP_K_STRING = "" \ "[<% kompatible_table.keys.each_regexp_chars do |rx|%><%=rx%>" \ - "<%end%>]" \ - "".freeze + "<%end%>]" class_table = { % combining_class.each_slice(8) do |slice| @@ -207,19 +204,19 @@ module UnicodeNormalize DECOMPOSITION_TABLE = { % decomposition_table.each_slice(8) do |slice| - <% slice.each do |key, value|%> "<%=key.to_UTF8%>"=>"<%=value.to_UTF8%>".freeze<%=%>,<% end%> + <% slice.each do |key, value|%> "<%=key.to_UTF8%>"=>"<%=value.to_UTF8%>"<%=%>,<% end%> % end }.freeze KOMPATIBLE_TABLE = { % kompatible_table.each_slice(8) do |slice| - <% slice.each do |key, value|%> "<%=key.to_UTF8%>"=>"<%=value.to_UTF8%>".freeze<%=%>,<% end%> + <% slice.each do |key, value|%> "<%=key.to_UTF8%>"=>"<%=value.to_UTF8%>"<%=%>,<% end%> % end }.freeze COMPOSITION_TABLE = { % composition_table.each_slice(8) do |slice| - <% slice.each do |key, value|%> "<%=key.to_UTF8%>"=>"<%=value.to_UTF8%>".freeze<%=%>,<% end%> + <% slice.each do |key, value|%> "<%=key.to_UTF8%>"=>"<%=value.to_UTF8%>"<%=%>,<% end%> % end }.freeze end |