add another simple function test
This commit is contained in:
parent
34691f36d1
commit
6246753c27
22
test/cases/function_definition/function_foo2.tst
Normal file
22
test/cases/function_definition/function_foo2.tst
Normal 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))))
|
Loading…
x
Reference in New Issue
Block a user