Class: YARP::StatementsNode
- Inherits:
-
YARPNode
- Object
- YARPNode
- YARP::StatementsNode
- Defined in:
- lib/yarp/node.rb,
ext/yarp/api_node.c
Overview
Represents a set of statements contained within some scope.
foo; bar; baz
^^^^^^^^^^^^^
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
attr_reader body: Array.
Instance Method Summary collapse
-
#accept(visitor) ⇒ Object
def accept: (visitor: Visitor) -> void.
-
#child_nodes ⇒ Object
(also: #deconstruct)
def child_nodes: () -> Array[nil | Node].
- #deconstruct_keys(keys) ⇒ Object
-
#initialize(body, location) ⇒ StatementsNode
constructor
def initialize: (body: Array, location: Location) -> void.
Constructor Details
#initialize(body, location) ⇒ StatementsNode
def initialize: (body: Array, location: Location) -> void
5717 5718 5719 5720 |
# File 'lib/yarp/node.rb', line 5717 def initialize(body, location) @body = body @location = location end |
Instance Attribute Details
#body ⇒ Object (readonly)
attr_reader body: Array
5714 5715 5716 |
# File 'lib/yarp/node.rb', line 5714 def body @body end |
Instance Method Details
#accept(visitor) ⇒ Object
def accept: (visitor: Visitor) -> void
5723 5724 5725 |
# File 'lib/yarp/node.rb', line 5723 def accept(visitor) visitor.visit_statements_node(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
def child_nodes: () -> Array[nil | Node]
5728 5729 5730 |
# File 'lib/yarp/node.rb', line 5728 def child_nodes [*body] end |