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.



9568
9569
9570
9571
# File 'lib/syntax_tree/node.rb', line 9568

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

Instance Attribute Details

#commentsObject (readonly)

Array[ Comment | EmbDoc ]

the comments attached to this node



9566
9567
9568
# File 'lib/syntax_tree/node.rb', line 9566

def comments
  @comments
end

#locationObject (readonly)

Location

the location of this node



9563
9564
9565
# File 'lib/syntax_tree/node.rb', line 9563

def location
  @location
end

Instance Method Details

#accept(visitor) ⇒ Object



9573
9574
9575
# File 'lib/syntax_tree/node.rb', line 9573

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

#child_nodesObject Also known as: deconstruct



9577
9578
9579
# File 'lib/syntax_tree/node.rb', line 9577

def child_nodes
  []
end

#deconstruct_keys(_keys) ⇒ Object



9583
9584
9585
# File 'lib/syntax_tree/node.rb', line 9583

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

#format(q) ⇒ Object



9587
9588
# File 'lib/syntax_tree/node.rb', line 9587

def format(q)
end