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.



9491
9492
9493
9494
# File 'lib/syntax_tree/node.rb', line 9491

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

Instance Attribute Details

#commentsObject (readonly)

Array[ Comment | EmbDoc ]

the comments attached to this node



9489
9490
9491
# File 'lib/syntax_tree/node.rb', line 9489

def comments
  @comments
end

#locationObject (readonly)

Location

the location of this node



9486
9487
9488
# File 'lib/syntax_tree/node.rb', line 9486

def location
  @location
end

Instance Method Details

#accept(visitor) ⇒ Object



9496
9497
9498
# File 'lib/syntax_tree/node.rb', line 9496

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

#child_nodesObject Also known as: deconstruct



9500
9501
9502
# File 'lib/syntax_tree/node.rb', line 9500

def child_nodes
  []
end

#deconstruct_keys(_keys) ⇒ Object



9506
9507
9508
# File 'lib/syntax_tree/node.rb', line 9506

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

#format(q) ⇒ Object



9510
9511
# File 'lib/syntax_tree/node.rb', line 9510

def format(q)
end