Sha256: e8418689e53a8bd64d3d24a781751c2a102d2c614ffced6eaab7975bfe87587c
Contents?: true
Size: 1.23 KB
Versions: 8
Compression:
Stored size: 1.23 KB
Contents
module Regexp::Expression module Backreference class Base < Regexp::Expression::Base; end class Number < Backreference::Base attr_reader :number def initialize(token, options = {}) @number = token.text[token.token.equal?(:number) ? 1..-1 : 3..-2].to_i super end end class Name < Backreference::Base attr_reader :name def initialize(token, options = {}) @name = token.text[3..-2] super end end class NumberCall < Backreference::Number; end class NumberRelative < Backreference::Number; end class NumberCallRelative < Backreference::Number; end class NameCall < Backreference::Name; end class NumberRecursionLevel < Backreference::Base attr_reader :number, :recursion_level def initialize(token, options = {}) @number, @recursion_level = token.text[3..-2].split(/(?=[+-])/).map(&:to_i) super end end class NameRecursionLevel < Backreference::Base attr_reader :name, :recursion_level def initialize(token, options = {}) @name, recursion_level = token.text[3..-2].split(/(?=[+-])/) @recursion_level = recursion_level.to_i super end end end end
Version data entries
8 entries across 8 versions & 2 rubygems