add another simple function test

This commit is contained in:
Torsten Ruger 2015-10-06 00:22:18 +03:00
parent 34691f36d1
commit 6246753c27
1 changed files with 22 additions and 0 deletions

View File

@ -0,0 +1,22 @@
int foo(int x)
int a = 5
return a
end
3.foo( 4 )
-- -- --
s(:expressions,
s(:function, :int,
s(:name, :foo),
s(:parameters,
s(:parameter, :int, :x)),
s(:expressions,
s(:field_def, :int, :a,
s(:int, 5)),
s(:return,
s(:name, :a)))),
s(:call,
s(:name, :foo),
s(:arguments,
s(:int, 4)),
s(:receiver,
s(:int, 3))))