lib/regexp-examples/chargroup_parser.rb in regexp-examples-1.3.1 vs lib/regexp-examples/chargroup_parser.rb in regexp-examples-1.3.2
- old
+ new
@@ -13,11 +13,11 @@
# [[^:alpha:]&&[\n]a-c] - all of the above!!!! (should match "\n")
class ChargroupParser
include CharsetNegationHelper
attr_reader :regexp_string, :current_position
- alias_method :length, :current_position
+ alias length current_position
def initialize(regexp_string, is_sub_group: false)
@regexp_string = regexp_string
@is_sub_group = is_sub_group
@current_position = 0
@@ -83,13 +83,13 @@
end
end
def parse_after_backslash
case next_char
- when *BackslashCharMap.keys
- BackslashCharMap[next_char]
when 'b'
["\b"]
+ when *BackslashCharMap.keys
+ BackslashCharMap[next_char]
else
[next_char]
end
end