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

#construct_keys, #pretty_print, #to_json

Constructor Details

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

Returns a new instance of VoidStmt.



9602
9603
9604
9605
# File 'lib/syntax_tree/node.rb', line 9602

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

Instance Attribute Details

#comments ⇒ Object (readonly)

[Array[ Comment | EmbDoc ]] the comments attached to this node



9600
9601
9602
# File 'lib/syntax_tree/node.rb', line 9600

def comments
  @comments
end

#location ⇒ Object (readonly)

[Location] the location of this node



9597
9598
9599
# File 'lib/syntax_tree/node.rb', line 9597

def location
  @location
end

Instance Method Details

#accept(visitor) ⇒ Object



9607
9608
9609
# File 'lib/syntax_tree/node.rb', line 9607

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

#child_nodes ⇒ Object Also known as: deconstruct



9611
9612
9613
# File 'lib/syntax_tree/node.rb', line 9611

def child_nodes
  []
end

#deconstruct_keys(_keys) ⇒ Object



9617
9618
9619
# File 'lib/syntax_tree/node.rb', line 9617

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

#format(q) ⇒ Object



9621
9622
# File 'lib/syntax_tree/node.rb', line 9621

def format(q)
end