mirror of
https://github.com/ruby/ruby.git
synced 2025-08-27 15:06:10 +02:00
* remove trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47809 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
33447b80d5
commit
cc8a255d25
1 changed files with 4 additions and 4 deletions
|
@ -20,9 +20,9 @@ class Array
|
||||||
def line_slice (new_line) # joins items, 16 items per line
|
def line_slice (new_line) # joins items, 16 items per line
|
||||||
each_slice(16).collect(&:join).join new_line
|
each_slice(16).collect(&:join).join new_line
|
||||||
end
|
end
|
||||||
|
|
||||||
def to_UTF8() collect(&:to_UTF8).join end
|
def to_UTF8() collect(&:to_UTF8).join end
|
||||||
|
|
||||||
def to_regexp_chars # converts an array of Integers to character ranges
|
def to_regexp_chars # converts an array of Integers to character ranges
|
||||||
sort.inject([]) do |ranges, value|
|
sort.inject([]) do |ranges, value|
|
||||||
if ranges.last and ranges.last[1]+1>=value
|
if ranges.last and ranges.last[1]+1>=value
|
||||||
|
@ -64,7 +64,7 @@ CombiningClass = {} # constant to allow use in Integer#to_UTF8
|
||||||
# read the file 'UnicodeData.txt'
|
# read the file 'UnicodeData.txt'
|
||||||
IO.foreach("../data/UnicodeData.txt") do |line|
|
IO.foreach("../data/UnicodeData.txt") do |line|
|
||||||
codepoint, name, _2, char_class, _4, decomposition, *_rest = line.split(";")
|
codepoint, name, _2, char_class, _4, decomposition, *_rest = line.split(";")
|
||||||
|
|
||||||
case decomposition
|
case decomposition
|
||||||
when /^[0-9A-F]/
|
when /^[0-9A-F]/
|
||||||
decomposition_table[codepoint.hex] = decomposition.split(' ').collect(&:hex)
|
decomposition_table[codepoint.hex] = decomposition.split(' ').collect(&:hex)
|
||||||
|
@ -72,7 +72,7 @@ IO.foreach("../data/UnicodeData.txt") do |line|
|
||||||
kompatible_table[codepoint.hex] = decomposition.split(' ').drop(1).collect(&:hex)
|
kompatible_table[codepoint.hex] = decomposition.split(' ').drop(1).collect(&:hex)
|
||||||
end
|
end
|
||||||
CombiningClass[codepoint.hex] = char_class.to_i if char_class != "0"
|
CombiningClass[codepoint.hex] = char_class.to_i if char_class != "0"
|
||||||
|
|
||||||
if name=~/(First|Last)>$/ and (char_class!="0" or decomposition!="")
|
if name=~/(First|Last)>$/ and (char_class!="0" or decomposition!="")
|
||||||
warn "Unexpected: Character range with data relevant to normalization!"
|
warn "Unexpected: Character range with data relevant to normalization!"
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue