Class: Momo::FuncCall

Inherits:
Object
  • Object
show all
Defined in:
lib/momo/funccall.rb

Direct Known Subclasses

BooleanValue, MemberReference

Instance Method Summary collapse

Constructor Details

#initialize(name, stack, *args) ⇒ FuncCall

Returns a new instance of FuncCall.



4
5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/momo/funccall.rb', line 4

def initialize(name, stack, *args)
	@name = name
	@args = []
	@stack = stack
	if !stack.is_a? Stack
		raise "#{stack.inspect} is not a stack"
	end
	args.each do |arg|
		@args << Momo.resolve(arg, stack: stack)
	end
	if @args.length == 1
		@args = @args[0]
	end
end

Instance Method Details

#representationObject



19
20
21
# File 'lib/momo/funccall.rb', line 19

def representation
	{@name => @args}
end