From 1fb502caca35b300fe6f852a89b4bef6bf73ad97 Mon Sep 17 00:00:00 2001 From: duerst Date: Tue, 29 Sep 2015 07:54:05 +0000 Subject: 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 --- template/unicode_norm_gen.tmpl | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'template/unicode_norm_gen.tmpl') 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 -- cgit v1.2.3