soml-parser/test/cases/function_definition/function_while.tst
2015-10-19 15:21:23 +03:00

30 lines
641 B
Scilab

Biggie fibonaccit(int n)
a = 0
while_ok(n)
some = 43
other = some * 4
end
end
-- -- --
s(:statements,
s(:function, :Biggie,
s(:name, :fibonaccit),
s(:parameters,
s(:parameter, :Integer, :n)),
s(:statements,
s(:assignment,
s(:name, :a),
s(:int, 0)),
s(:while_statement, :ok,
s(:conditional,
s(:name, :n)),
s(:statements,
s(:assignment,
s(:name, :some),
s(:int, 43)),
s(:assignment,
s(:name, :other),
s(:operator_value, :*,
s(:name, :some),
s(:int, 4))))))))