Class: Regexp::Expression::Backreference::Base
- Inherits:
-
Regexp::Expression::Base
- Object
- Regexp::Expression::Base
- Regexp::Expression::Backreference::Base
- Defined in:
- lib/regexp_parser/expression/classes/backreference.rb
Instance Attribute Summary collapse
-
#referenced_expression ⇒ Object
Returns the value of attribute referenced_expression.
Instance Method Summary collapse
Methods inherited from Regexp::Expression::Base
#ascii_classes?, #case_insensitive?, #default_classes?, #free_spacing?, #greedy?, #initialize, #match, #match?, #multiline?, #possessive?, #quantify, #quantity, #reluctant?, #repetitions, #strfregexp, #to_h, #to_re, #unicode_classes?, #unquantified_clone
Methods included from Shared
#==, #base_length, #coded_offset, #full_length, #human_name, included, #is?, #nesting_level=, #offset, #one_of?, #optional?, #parts, #quantified?, #quantifier=, #quantifier_affix, #starts_at, #terminal?, #to_s, #token_class, #type?
Constructor Details
This class inherits a constructor from Regexp::Expression::Base
Instance Attribute Details
#referenced_expression ⇒ Object
Returns the value of attribute referenced_expression.
5 6 7 |
# File 'lib/regexp_parser/expression/classes/backreference.rb', line 5 def referenced_expression @referenced_expression end |
Instance Method Details
#initialize_copy(orig) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/regexp_parser/expression/classes/backreference.rb', line 7 def initialize_copy(orig) exp_id = [self.class, self.starts_at] # prevent infinite recursion for recursive subexp calls copied = @@copied ||= {} self.referenced_expression = if copied[exp_id] orig.referenced_expression else copied[exp_id] = true orig.referenced_expression.dup end copied.clear super end |