Skip to content

Commit

Permalink
Merge pull request #184 from mame/faster-regexps-for-east-asian-width
Browse files Browse the repository at this point in the history
Improve the regexps for EastAsianWidth
  • Loading branch information
aycabta authored Oct 20, 2020
2 parents ffc0355 + 8b09268 commit 92eb0bd
Show file tree
Hide file tree
Showing 2 changed files with 1,152 additions and 1,152 deletions.
8 changes: 4 additions & 4 deletions bin/generate_east_asian_width
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,15 @@ EOH
when :A then 'Ambiguous'
when :N then 'Neutral'
end
output += " TYPE_%s = /^(\n" % type.upcase
output += " TYPE_%s = /^([\#{ %%W(\n" % type.upcase
output += ranges.map { |range|
if range.first == range.last
' \u{%04X}' % range.first
else
' [\u{%04X}-\u{%04X}]' % [range.first, range.last]
' \u{%04X}-\u{%04X}' % [range.first, range.last]
end
}.join(" |\n")
output += "\n )/x\n"
}.join("\n")
output += "\n ).join }])/\n"
}.join("\n")
puts 'end'
end
Loading

0 comments on commit 92eb0bd

Please sign in to comment.