Rename start/end to min/max for CharacterRangeUnit
This commit is contained in:
parent
9b09625c8a
commit
33f9d01883
@ -57,11 +57,11 @@ module Imbecile
|
||||
end
|
||||
|
||||
class CharacterRangeUnit < Unit
|
||||
attr_accessor :start_code_point
|
||||
attr_accessor :end_code_point
|
||||
attr_accessor :min_code_point
|
||||
attr_accessor :max_code_point
|
||||
def initialize(c1, c2)
|
||||
@start_code_point = c1.ord
|
||||
@end_code_point = c2.ord
|
||||
@min_code_point = c1.ord
|
||||
@max_code_point = c2.ord
|
||||
end
|
||||
end
|
||||
|
||||
@ -163,12 +163,12 @@ module Imbecile
|
||||
unless end_cu.is_a?(CharacterUnit)
|
||||
raise Error.new("Character range must be between single characters")
|
||||
end
|
||||
end_code_point = end_cu.code_point
|
||||
max_code_point = end_cu.code_point
|
||||
else
|
||||
end_code_point = @pattern[0].ord
|
||||
max_code_point = @pattern[0].ord
|
||||
@pattern.slice!(0)
|
||||
end
|
||||
cru = CharacterRangeUnit.new(begin_cu.code_point, end_code_point)
|
||||
cru = CharacterRangeUnit.new(begin_cu.code_point, max_code_point)
|
||||
au.replace_last!(cru)
|
||||
else
|
||||
au.append_alternate(CharacterUnit.new(c))
|
||||
|
Loading…
x
Reference in New Issue
Block a user