Skip to content

Commit 6d94f2a

Browse files
authored
Set EastAsianWidth::UNICODE_VERSION (#586)
* Set EastAsianWidth::UNICODE_VERSION * Commented out UNICODE_VERSION in Reline::Unicode::EastAsianWidth * Commented out UNICODE_VERSION in Reline::Unicode::EastAsianWidth
1 parent 7d2084b commit 6d94f2a

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

bin/generate_east_asian_width

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ if ARGV.empty?
66
end
77

88
open(ARGV.first, 'rt') do |f|
9+
if m = f.gets.match(/^# EastAsianWidth-(\d+\.\d+\.\d+)\.txt/)
10+
unicode_version = m[1]
11+
else
12+
warn 'Failed to get UNICODE_VERSION'
13+
unicode_version = nil
14+
end
15+
916
list = []
1017
f.each_line do |line|
1118
next unless m = line.match(/^(\h+)(?:\.\.(\h+))?\s*;\s*(\w+)\s+#.+/)
@@ -44,6 +51,7 @@ open(ARGV.first, 'rt') do |f|
4451
class Reline::Unicode::EastAsianWidth
4552
# This is based on EastAsianWidth.txt
4653
# #{ARGV.first}
54+
# UNICODE_VERSION = #{unicode_version ? "'#{unicode_version}'" : 'nil'}
4755
4856
EOH
4957
puts grouped.map { |item|

lib/reline/unicode/east_asian_width.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
class Reline::Unicode::EastAsianWidth
22
# This is based on EastAsianWidth.txt
33
# EastAsianWidth.txt
4+
# UNICODE_VERSION = '15.0.0'
45

56
# Fullwidth
67
TYPE_F = /^[#{ %W(

0 commit comments

Comments
 (0)