Use the hexdigit character class
This commit is contained in:
parent
ec3d81629f
commit
4909747e5a
@ -166,7 +166,7 @@ def parse_scripts(data, categories)
|
|||||||
categories[current] = file[:title]
|
categories[current] = file[:title]
|
||||||
(names[file[:title]] ||= []) << current
|
(names[file[:title]] ||= []) << current
|
||||||
cps = []
|
cps = []
|
||||||
elsif /^([0-9a-fA-F]+)(?:\.\.([0-9a-fA-F]+))?\s*;\s*(\w+)/ =~ line
|
elsif /^(\h+)(?:\.\.(\h+))?\s*;\s*(\w+)/ =~ line
|
||||||
current = $3
|
current = $3
|
||||||
$2 ? cps.concat(($1.to_i(16)..$2.to_i(16)).to_a) : cps.push($1.to_i(16))
|
$2 ? cps.concat(($1.to_i(16)..$2.to_i(16)).to_a) : cps.push($1.to_i(16))
|
||||||
end
|
end
|
||||||
@ -221,7 +221,7 @@ def parse_age(data)
|
|||||||
ages << current
|
ages << current
|
||||||
last_constname = constname
|
last_constname = constname
|
||||||
cps = []
|
cps = []
|
||||||
elsif /^([0-9a-fA-F]+)(?:\.\.([0-9a-fA-F]+))?\s*;\s*(\d+\.\d+)/ =~ line
|
elsif /^(\h+)(?:\.\.(\h+))?\s*;\s*(\d+\.\d+)/ =~ line
|
||||||
current = $3
|
current = $3
|
||||||
$2 ? cps.concat(($1.to_i(16)..$2.to_i(16)).to_a) : cps.push($1.to_i(16))
|
$2 ? cps.concat(($1.to_i(16)..$2.to_i(16)).to_a) : cps.push($1.to_i(16))
|
||||||
end
|
end
|
||||||
@ -240,7 +240,7 @@ def parse_GraphemeBreakProperty(data)
|
|||||||
make_const(constname, cps, "Grapheme_Cluster_Break=#{current}")
|
make_const(constname, cps, "Grapheme_Cluster_Break=#{current}")
|
||||||
ages << current
|
ages << current
|
||||||
cps = []
|
cps = []
|
||||||
elsif /^([0-9a-fA-F]+)(?:\.\.([0-9a-fA-F]+))?\s*;\s*(\w+)/ =~ line
|
elsif /^(\h+)(?:\.\.(\h+))?\s*;\s*(\w+)/ =~ line
|
||||||
current = $3
|
current = $3
|
||||||
$2 ? cps.concat(($1.to_i(16)..$2.to_i(16)).to_a) : cps.push($1.to_i(16))
|
$2 ? cps.concat(($1.to_i(16)..$2.to_i(16)).to_a) : cps.push($1.to_i(16))
|
||||||
end
|
end
|
||||||
@ -252,7 +252,7 @@ def parse_block(data)
|
|||||||
cps = []
|
cps = []
|
||||||
blocks = []
|
blocks = []
|
||||||
data_foreach('Blocks.txt') do |line|
|
data_foreach('Blocks.txt') do |line|
|
||||||
if /^([0-9a-fA-F]+)\.\.([0-9a-fA-F]+);\s*(.*)/ =~ line
|
if /^(\h+)\.\.(\h+);\s*(.*)/ =~ line
|
||||||
cps = ($1.to_i(16)..$2.to_i(16)).to_a
|
cps = ($1.to_i(16)..$2.to_i(16)).to_a
|
||||||
constname = constantize_blockname($3)
|
constname = constantize_blockname($3)
|
||||||
data[constname] = cps
|
data[constname] = cps
|
||||||
|
Loading…
x
Reference in New Issue
Block a user