soml-parser/test/cases/function_definition/function_if.tst
2015-10-09 17:28:47 +03:00

26 lines
509 B
Scilab

ref ofthen(int n)
if(0)
isit = 42
else
maybenot = 667
end
end
-- -- --
s(:statements,
s(:function, :ref,
s(:name, :ofthen),
s(:parameters,
s(:parameter, :int, :n)),
s(:statements,
s(:if_statement,
s(:condition,
s(:int, 0)),
s(:true_statements,
s(:assignment,
s(:name, :isit),
s(:int, 42))),
s(:false_statements,
s(:assignment,
s(:name, :maybenot),
s(:int, 667)))))))