Class: FunctionDecNode

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

Overview

Function Nodes

Instance Attribute Summary

Attributes inherited from Node

#value

Instance Method Summary collapse

Methods inherited from Node

#to_s

Constructor Details

#initialize(node, value) ⇒ FunctionDecNode



50
51
52
53
54
# File 'lib/nodes/stmtnodes.rb', line 50

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

Instance Method Details

#evaluateObject



56
57
58
59
# File 'lib/nodes/stmtnodes.rb', line 56

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