soml-parser/test/cases/class_definition/class_if.tst

31 lines
662 B
Scilab
Raw Normal View History

class Ifi
int ofthen(int n)
if(0)
isit = 42
else
maybenot = 667
end
end
end
-- -- --
2015-10-09 16:32:05 +02:00
s(:statements,
2015-09-19 16:11:15 +02:00
s(:class, :Ifi,
s(:derives, nil),
2015-10-09 16:32:05 +02:00
s(:statements,
s(:function, :int,
s(:name, :ofthen),
s(:parameters,
s(:parameter, :int, :n)),
2015-10-09 16:32:05 +02:00
s(:statements,
s(:if_statement,
s(:condition,
s(:int, 0)),
2015-10-09 16:32:05 +02:00
s(:true_statements,
s(:assignment,
s(:name, :isit),
s(:int, 42))),
2015-10-09 16:32:05 +02:00
s(:false_statements,
s(:assignment,
s(:name, :maybenot),
s(:int, 667)))))))))