Class: FunctionDecNode

Inherits:
Node
  • Object
show all
Defined in:
lib/nodes/stmtnodes.rb

Instance Attribute Summary

Attributes inherited from Node

#value

Instance Method Summary collapse

Methods inherited from Node

#to_s

Constructor Details

#initialize(node, value) ⇒ FunctionDecNode

Returns a new instance of FunctionDecNode.



35
36
37
38
39
# File 'lib/nodes/stmtnodes.rb', line 35

def initialize(node, value)
  super(value)
  @name = node
  @args = node.args
end

Instance Method Details

#evaluateObject



41
42
43
44
# File 'lib/nodes/stmtnodes.rb', line 41

def evaluate
  ScopeManager.add_func_to_global_scope(@name, @value, @args)
  return nil
end