зеркало из https://github.com/github/ruby.git
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
This commit is contained in:
Родитель
ed8b452e37
Коммит
1fb502caca
|
@ -1,3 +1,9 @@
|
|||
Tue Sep 29 16:53:53 2015 Martin Duerst <duerst@it.aoyama.ac.jp>
|
||||
|
||||
* tool/unicode_norm_gen.tmpl, lib/unicode_normalize/tables.rb:
|
||||
get rid of many .freeze commands by using frozen_string_literal
|
||||
pragma.
|
||||
|
||||
Tue Sep 29 16:37:29 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* compile.c (compile_dstr_fragments): fix performance by omitting
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче