Skip to content

Commit

Permalink
Set EastAsianWidth::UNICODE_VERSION (#586)
Browse files Browse the repository at this point in the history
* Set EastAsianWidth::UNICODE_VERSION

* Commented out UNICODE_VERSION in Reline::Unicode::EastAsianWidth

* Commented out UNICODE_VERSION in Reline::Unicode::EastAsianWidth
  • Loading branch information
elfham committed Aug 29, 2023
1 parent 7d2084b commit 6d94f2a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions bin/generate_east_asian_width
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ if ARGV.empty?
end

open(ARGV.first, 'rt') do |f|
if m = f.gets.match(/^# EastAsianWidth-(\d+\.\d+\.\d+)\.txt/)
unicode_version = m[1]
else
warn 'Failed to get UNICODE_VERSION'
unicode_version = nil
end

list = []
f.each_line do |line|
next unless m = line.match(/^(\h+)(?:\.\.(\h+))?\s*;\s*(\w+)\s+#.+/)
Expand Down Expand Up @@ -44,6 +51,7 @@ open(ARGV.first, 'rt') do |f|
class Reline::Unicode::EastAsianWidth
# This is based on EastAsianWidth.txt
# #{ARGV.first}
# UNICODE_VERSION = #{unicode_version ? "'#{unicode_version}'" : 'nil'}
EOH
puts grouped.map { |item|
Expand Down
1 change: 1 addition & 0 deletions lib/reline/unicode/east_asian_width.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
class Reline::Unicode::EastAsianWidth
# This is based on EastAsianWidth.txt
# EastAsianWidth.txt
# UNICODE_VERSION = '15.0.0'

# Fullwidth
TYPE_F = /^[#{ %W(
Expand Down

0 comments on commit 6d94f2a

Please sign in to comment.