* enc/unicode/case-folding.rb: Adding possibility for debugging output
for TitleCase table in casefold.h. (with Kimihito Matsui) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53930 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
92e0377ed4
commit
7feb182a08
@ -1,3 +1,9 @@
|
|||||||
|
Thu Feb 25 19:04:13 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
|
||||||
|
|
||||||
|
* enc/unicode/case-folding.rb: Adding possibility for debugging output
|
||||||
|
for TitleCase table in casefold.h.
|
||||||
|
(with Kimihito Matsui)
|
||||||
|
|
||||||
Wed Feb 24 22:31:13 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
|
Wed Feb 24 22:31:13 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
|
||||||
|
|
||||||
* include/ruby/oniguruma.h: Rearranging flag assignments and making
|
* include/ruby/oniguruma.h: Rearranging flag assignments and making
|
||||||
|
@ -245,11 +245,16 @@ class CaseMapping
|
|||||||
flags
|
flags
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def debug!
|
||||||
|
@debug = true
|
||||||
|
end
|
||||||
|
|
||||||
def titlecase_output
|
def titlecase_output
|
||||||
"CodePointList3 TitleCase[] = {\n" +
|
"CodePointList3 TitleCase[] = {\n" +
|
||||||
@titlecase.map do |item|
|
@titlecase.map do |item|
|
||||||
chars = item.title.split(/ /)
|
chars = item.title.split(/ /)
|
||||||
" {#{chars.length}, {" + chars.map {|c| "0x"+c }.join(', ') + "}},\n"
|
ct = ' /* ' + Array(chars).map{|c|[c.to_i(16)].pack("U*")}.join(", ") + ' */' if @debug
|
||||||
|
" {#{chars.length}, {#{chars.map {|c| "0x"+c }.join(', ')}#{ct}}},\n"
|
||||||
end.join + "};\n"
|
end.join + "};\n"
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -264,6 +269,7 @@ class CaseMappingDummy
|
|||||||
end
|
end
|
||||||
|
|
||||||
def titlecase_output() '' end
|
def titlecase_output() '' end
|
||||||
|
def debug!() end
|
||||||
end
|
end
|
||||||
|
|
||||||
if $0 == __FILE__
|
if $0 == __FILE__
|
||||||
@ -299,7 +305,10 @@ if $0 == __FILE__
|
|||||||
mapping_data ||= CaseMappingDummy.new
|
mapping_data ||= CaseMappingDummy.new
|
||||||
|
|
||||||
data = CaseFolding.load(filename)
|
data = CaseFolding.load(filename)
|
||||||
data.debug! if debug
|
if debug
|
||||||
|
data.debug!
|
||||||
|
mapping_data.debug!
|
||||||
|
end
|
||||||
if dest
|
if dest
|
||||||
open(dest, "wb") do |f|
|
open(dest, "wb") do |f|
|
||||||
data.display(f, mapping_data)
|
data.display(f, mapping_data)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user