Class: Masamune::AbstractSyntaxTree::ParametersVisitor

Inherits:
Prism::Visitor
  • Object
show all
Defined in:
lib/masamune/abstract_syntax_tree/visitors/parameters_visitor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeParametersVisitor

Returns a new instance of ParametersVisitor.



6
7
8
# File 'lib/masamune/abstract_syntax_tree/visitors/parameters_visitor.rb', line 6

def initialize
  @results = []
end

Instance Attribute Details

#resultsObject (readonly)

Returns the value of attribute results.



4
5
6
# File 'lib/masamune/abstract_syntax_tree/visitors/parameters_visitor.rb', line 4

def results
  @results
end

Instance Method Details

#visit_parameters_node(node) ⇒ Object

Since parameters nodes can house multiple variables in one node, we don’t have to check for a token_value.



12
13
14
15
# File 'lib/masamune/abstract_syntax_tree/visitors/parameters_visitor.rb', line 12

def visit_parameters_node(node)
  results << node
  super
end