Class: SyntaxTree::VoidStmt
Overview
VoidStmt represents an empty lexical block of code.
;;
Instance Attribute Summary collapse
-
#comments ⇒ Object
readonly
- Array[ Comment | EmbDoc ]
-
the comments attached to this node.
-
#location ⇒ Object
readonly
- Location
-
the location of this node.
Instance Method Summary collapse
- #accept(visitor) ⇒ Object
- #child_nodes ⇒ Object (also: #deconstruct)
- #deconstruct_keys(_keys) ⇒ Object
- #format(q) ⇒ Object
-
#initialize(location:, comments: []) ⇒ VoidStmt
constructor
A new instance of VoidStmt.
Methods inherited from Node
#construct_keys, #pretty_print, #to_json
Constructor Details
#initialize(location:, comments: []) ⇒ VoidStmt
Returns a new instance of VoidStmt.
9613 9614 9615 9616 |
# File 'lib/syntax_tree/node.rb', line 9613 def initialize(location:, comments: []) @location = location @comments = comments end |
Instance Attribute Details
#comments ⇒ Object (readonly)
- Array[ Comment | EmbDoc ]
-
the comments attached to this node
9611 9612 9613 |
# File 'lib/syntax_tree/node.rb', line 9611 def comments @comments end |
#location ⇒ Object (readonly)
- Location
-
the location of this node
9608 9609 9610 |
# File 'lib/syntax_tree/node.rb', line 9608 def location @location end |
Instance Method Details
#accept(visitor) ⇒ Object
9618 9619 9620 |
# File 'lib/syntax_tree/node.rb', line 9618 def accept(visitor) visitor.visit_void_stmt(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
9622 9623 9624 |
# File 'lib/syntax_tree/node.rb', line 9622 def child_nodes [] end |
#deconstruct_keys(_keys) ⇒ Object
9628 9629 9630 |
# File 'lib/syntax_tree/node.rb', line 9628 def deconstruct_keys(_keys) { location: location, comments: comments } end |
#format(q) ⇒ Object
9632 9633 |
# File 'lib/syntax_tree/node.rb', line 9632 def format(q) end |