Class: Regexp::Expression::Sequence
- Inherits:
-
Subexpression
- Object
- Base
- Subexpression
- Regexp::Expression::Sequence
- Defined in:
- lib/regexp_parser/expression/classes/alternation.rb
Overview
A sequence of expressions, used by alternations as one alternative. TODO: perhaps rename this to Alternative?
Instance Attribute Summary
Attributes inherited from Subexpression
Attributes inherited from Base
#level, #options, #quantifier, #text, #token, #ts, #type
Instance Method Summary collapse
-
#initialize ⇒ Sequence
constructor
A new instance of Sequence.
- #quantify(token, text, min = nil, max = nil, mode = :greedy) ⇒ Object
- #starts_at ⇒ Object
Methods inherited from Subexpression
#<<, #[], #clone, #each, #each_with_index, #first, #insert, #last, #length, #to_s
Methods inherited from Base
#case_insensitive?, #clone, #coded_offset, #free_spacing?, #full_length, #greedy?, #multiline?, #offset, #possessive?, #quantified?, #quantity, #reluctant?, #terminal?, #to_re, #to_s
Constructor Details
Instance Method Details
#quantify(token, text, min = nil, max = nil, mode = :greedy) ⇒ Object
42 43 44 |
# File 'lib/regexp_parser/expression/classes/alternation.rb', line 42 def quantify(token, text, min = nil, max = nil, mode = :greedy) last.quantify(token, text, min, max, mode) end |
#starts_at ⇒ Object
38 39 40 |
# File 'lib/regexp_parser/expression/classes/alternation.rb', line 38 def starts_at @expressions.first.starts_at end |