From 33f9d01883d5d3560ee544c0bb9805ea29cc77ce Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Tue, 11 May 2021 15:28:45 -0400 Subject: [PATCH] Rename start/end to min/max for CharacterRangeUnit --- lib/imbecile/regex/parser.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/imbecile/regex/parser.rb b/lib/imbecile/regex/parser.rb index d3ec598..bb7dfd4 100644 --- a/lib/imbecile/regex/parser.rb +++ b/lib/imbecile/regex/parser.rb @@ -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))