Class: GhostWheel::Expression::Sequence
- Inherits:
-
GhostWheel::Expression
- Object
- GhostWheel::Expression
- GhostWheel::Expression::Sequence
- Defined in:
- lib/ghost_wheel/expression/sequence.rb
Instance Attribute Summary collapse
-
#expressions ⇒ Object
readonly
Returns the value of attribute expressions.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(*expressions) ⇒ Sequence
constructor
A new instance of Sequence.
- #uncached_parse(scanner, cache) ⇒ Object
Methods inherited from GhostWheel::Expression
Constructor Details
#initialize(*expressions) ⇒ Sequence
Returns a new instance of Sequence.
6 7 8 |
# File 'lib/ghost_wheel/expression/sequence.rb', line 6 def initialize(*expressions) @expressions = expressions end |
Instance Attribute Details
#expressions ⇒ Object (readonly)
Returns the value of attribute expressions.
10 11 12 |
# File 'lib/ghost_wheel/expression/sequence.rb', line 10 def expressions @expressions end |
Instance Method Details
#==(other) ⇒ Object
25 26 27 |
# File 'lib/ghost_wheel/expression/sequence.rb', line 25 def ==(other) super and @expressions == other.expressions end |
#uncached_parse(scanner, cache) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/ghost_wheel/expression/sequence.rb', line 12 def uncached_parse(scanner, cache) scanner.transaction do parsed = ParseResult.new(Array.new) @expressions.each do |expression| case result = expression.parse(scanner, cache) when FailedParseResult then scanner.abort(result) when ParseResult then parsed.value << result.value end end parsed end end |