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.



9379
9380
9381
9382
# File 'lib/syntax_tree/node.rb', line 9379

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

Instance Attribute Details

#comments ⇒ Object (readonly)

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



9377
9378
9379
# File 'lib/syntax_tree/node.rb', line 9377

def comments
  @comments
end

#location ⇒ Object (readonly)

[Location] the location of this node



9374
9375
9376
# File 'lib/syntax_tree/node.rb', line 9374

def location
  @location
end

Instance Method Details

#accept(visitor) ⇒ Object



9384
9385
9386
# File 'lib/syntax_tree/node.rb', line 9384

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

#child_nodes ⇒ Object Also known as: deconstruct



9388
9389
9390
# File 'lib/syntax_tree/node.rb', line 9388

def child_nodes
  []
end

#deconstruct_keys(keys) ⇒ Object



9394
9395
9396
# File 'lib/syntax_tree/node.rb', line 9394

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

#format(q) ⇒ Object



9398
9399
# File 'lib/syntax_tree/node.rb', line 9398

def format(q)
end