Class: Malady::AST::FunctionCallNode

Inherits:
Node
  • Object
show all
Defined in:
lib/malady/ast.rb

Instance Attribute Summary collapse

Attributes inherited from Node

#filename, #line

Instance Method Summary collapse

Methods inherited from Node

#pos

Constructor Details

#initialize(filename, line, function, arguments) ⇒ FunctionCallNode

Returns a new instance of FunctionCallNode.



281
282
283
284
285
# File 'lib/malady/ast.rb', line 281

def initialize(filename, line, function, arguments)
  super
  @function = function
  @arguments = arguments
end

Instance Attribute Details

#argumentsObject (readonly)

Returns the value of attribute arguments.



279
280
281
# File 'lib/malady/ast.rb', line 279

def arguments
  @arguments
end

#functionObject (readonly)

Returns the value of attribute function.



279
280
281
# File 'lib/malady/ast.rb', line 279

def function
  @function
end

Instance Method Details

#bytecode(g) ⇒ Object



287
288
289
290
291
292
293
294
295
# File 'lib/malady/ast.rb', line 287

def bytecode(g)
  function.bytecode(g)

  @arguments.each do |val|
    val.bytecode(g)
  end

  g.send :call, @arguments.count
end