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

30 lines
630 B
Scilab
Raw Normal View History

class Foo < Object
2015-09-27 11:05:35 +02:00
field int fff = 3
2015-09-20 13:29:24 +02:00
int func()
2015-09-27 11:05:35 +02:00
return self.fff
2015-09-20 13:29:24 +02:00
end
ofthen(3 , var)
end
-- -- --
2015-09-20 13:29:24 +02:00
s(:expressions,
s(:class, :Foo,
s(:derives, :Object),
s(:expressions,
2015-09-27 11:05:35 +02:00
s(:class_field, :int, :fff,
s(:int, 3)),
s(:function, :int,
s(:name, :func),
s(:parameters),
s(:expressions,
s(:return,
s(:field_access,
s(:receiver,
s(:name, :self)),
s(:field,
2015-09-27 11:05:35 +02:00
s(:name, :fff)))))),
s(:call,
s(:name, :ofthen),
s(:arguments,
s(:int, 3),
s(:name, :var))))))