soml-parser/test/cases/function_definition/function_while.tst
Torsten Ruger ea6472c28f rename field to parameter in parameter_list
also field to field_def (wip)
and lots of whitespace due to ws fix
2015-09-20 12:56:06 +03:00

30 lines
597 B
Scilab

ref fibonaccit(int n)
a = 0
while(n)
some = 43
other = some * 4
end
end
-- -- --
s(:expressions,
s(:function, :ref,
s(:name, :fibonaccit),
s(:parameters,
s(:parameter, :int, :n)),
s(:expressions,
s(:assign,
s(:name, :a),
s(:int, 0)),
s(:while,
s(:condition,
s(:name, :n)),
s(:expressions,
s(:assign,
s(:name, :some),
s(:int, 43)),
s(:assign,
s(:name, :other),
s(:operator, "*",
s(:name, :some),
s(:int, 4))))))))