soml-parser/test/cases/module_def/module_ops.tst

29 lines
639 B
Scilab
Raw Normal View History

module Opers
int foo(int x)
2015-09-20 11:50:06 +02:00
int abba = x + self.index
return abba + 5
end
end
-- -- --
2015-09-20 11:50:06 +02:00
s(:expressions,
s(:module, :Opers,
s(:function, :int,
s(:name, :foo),
s(:parameters,
s(:parameter, :int, :x)),
2015-09-20 11:50:06 +02:00
s(:expressions,
s(:name, :int),
s(:assign,
s(:name, :abba),
s(:operator, "+",
s(:name, :x),
s(:field_access,
s(:receiver,
s(:name, :self)),
s(:field,
s(:name, :index))))),
s(:return,
s(:operator, "+",
s(:name, :abba),
s(:int, 5)))))))