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