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.



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

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

Instance Attribute Details

#commentsObject (readonly)

Array[ Comment | EmbDoc ]

the comments attached to this node



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

def comments
  @comments
end

#locationObject (readonly)

Location

the location of this node



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

def location
  @location
end

Instance Method Details

#accept(visitor) ⇒ Object



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

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

#child_nodesObject Also known as: deconstruct



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

def child_nodes
  []
end

#deconstruct_keys(keys) ⇒ Object



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

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

#format(q) ⇒ Object



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

def format(q)
end