Class: SyntaxTree::VoidStmt

Inherits:
Node
  • Object
show all
Defined in:
lib/syntax_tree/node.rb

Overview

VoidStmt represents an empty lexical block of code.

;;

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Node

#pretty_print, #to_json

Constructor Details

#initialize(location:, comments: []) ⇒ VoidStmt

Returns a new instance of VoidStmt.



8814
8815
8816
8817
# File 'lib/syntax_tree/node.rb', line 8814

def initialize(location:, comments: [])
  @location = location
  @comments = comments
end

Instance Attribute Details

#commentsObject (readonly)

Array[ Comment | EmbDoc ]

the comments attached to this node



8812
8813
8814
# File 'lib/syntax_tree/node.rb', line 8812

def comments
  @comments
end

#locationObject (readonly)

Location

the location of this node



8809
8810
8811
# File 'lib/syntax_tree/node.rb', line 8809

def location
  @location
end

Instance Method Details

#accept(visitor) ⇒ Object



8819
8820
8821
# File 'lib/syntax_tree/node.rb', line 8819

def accept(visitor)
  visitor.visit_void_stmt(self)
end

#child_nodesObject Also known as: deconstruct



8823
8824
8825
# File 'lib/syntax_tree/node.rb', line 8823

def child_nodes
  []
end

#deconstruct_keys(keys) ⇒ Object



8829
8830
8831
# File 'lib/syntax_tree/node.rb', line 8829

def deconstruct_keys(keys)
  { location: location, comments: comments }
end

#format(q) ⇒ Object



8833
8834
# File 'lib/syntax_tree/node.rb', line 8833

def format(q)
end