Class: Spectre::Operators::Positive
- Inherits:
-
Object
- Object
- Spectre::Operators::Positive
- Includes:
- Op
- Defined in:
- lib/spectre/base/operators.rb
Overview
Matches the given Node 1 or more times. Positive.new p is equal to p.
+.
Instance Attribute Summary
Attributes included from Parser
Instance Method Summary collapse
Methods included from Op
Methods included from Parser
#backtrack, #create_match, from_POD, #pre_skip?, #to_p
Instance Method Details
#inspect ⇒ Object
292 293 294 |
# File 'lib/spectre/base/operators.rb', line 292 def inspect '(' + @node.left.inspect + '.+)' end |
#scan(iter) ⇒ Object
279 280 281 282 283 284 285 286 287 288 289 290 |
# File 'lib/spectre/base/operators.rb', line 279 def scan iter ret = @node.left.parse iter return nil unless ret val = ret.value while ret ret = @node.left.parse iter val = iter.concat val, ret.value if ret end create_match iter, val end |