Class: Twostroke::AST::MultiExpression
- Defined in:
- lib/twostroke/ast/multi_expression.rb
Instance Attribute Summary collapse
-
#left ⇒ Object
Returns the value of attribute left.
-
#right ⇒ Object
Returns the value of attribute right.
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from Twostroke::AST::Base
Instance Attribute Details
#left ⇒ Object
Returns the value of attribute left.
3 4 5 |
# File 'lib/twostroke/ast/multi_expression.rb', line 3 def left @left end |
#right ⇒ Object
Returns the value of attribute right.
3 4 5 |
# File 'lib/twostroke/ast/multi_expression.rb', line 3 def right @right end |
Instance Method Details
#collapse ⇒ Object
5 6 7 |
# File 'lib/twostroke/ast/multi_expression.rb', line 5 def collapse self.class.new left: left.collapse, right: right.collapse end |
#walk(&bk) ⇒ Object
9 10 11 12 13 14 |
# File 'lib/twostroke/ast/multi_expression.rb', line 9 def walk(&bk) if yield self left.walk &bk right.walk &bk end end |