summaryrefslogtreecommitdiff
path: root/template
diff options
context:
space:
mode:
authorduerst <duerst@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-09-29 07:54:05 +0000
committerduerst <duerst@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-09-29 07:54:05 +0000
commit1fb502caca35b300fe6f852a89b4bef6bf73ad97 (patch)
treed85a65158ae60ffd251bc1c2a9861c059d9c45b7 /template
parented8b452e37322e66eb94dafa36f2b5da8f5ca44a (diff)
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.tmpl21
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