soml-parser/test/cases/function_definition/function_while.tst

30 lines
621 B
Scilab
Raw Normal View History

ref fibonaccit(int n)
a = 0
while(n)
some = 43
other = some * 4
end
end
-- -- --
2015-10-09 16:28:47 +02:00
s(:statements,
s(:function, :ref,
s(:name, :fibonaccit),
s(:parameters,
s(:parameter, :int, :n)),
2015-10-09 16:28:47 +02:00
s(:statements,
s(:assignment,
s(:name, :a),
s(:int, 0)),
2015-10-09 16:28:47 +02:00
s(:while_statement,
s(:condition,
s(:name, :n)),
2015-10-09 16:28:47 +02:00
s(:statements,
s(:assignment,
s(:name, :some),
s(:int, 43)),
2015-10-09 16:28:47 +02:00
s(:assignment,
s(:name, :other),
2015-10-09 16:28:47 +02:00
s(:operator_value, :*,
s(:name, :some),
s(:int, 4))))))))