(* Time to test some INvalid code *) (** * Empty class *) class A { } (** * Inheriting class that also does stuff *) Class test:; -- First feature rule a: Int <- ; -- Second feature rule b Int <- 2; test(): nt { -- Third feature rule 0 ; -- Test some expressions -- t1: Int <- let let c: Int <- 3 <- 5 in { a+b+c+1+test,length(); }; t2: String <- 2.concat("blabla"); -- legal but never terminates, so the (new BB__) call below doesn't halt endless: Int <- { while not false loop 0 pool; pool; 0; }; t3: Bool <- a <-<= b; -- Fun with nested ifs t4: Bool <- if if if if true = then if a < b then false else true fi then false else if true then false else true fi fi then false else true fi then false else true fi then false else true fi; -- Let expression blah(): Int { let c Int <- a - b, d: Int <- b - a - c - b * c in { b <- {{d + c; t1; } }; -- A more complex function test2(a: Int, b: Int, c: String, d: Bool): Bool { if (a "Int"; s: String => "String"; i: IO => { i.out_string("haha"); "IO object"; }; o: Object => "Just some object"; esac; "This is returned, the above is never returned ('haha' might print though)"; }; }; -- Just to make it legal class Main inherits IO { main(): Int {{ out_int((new BB__).blah()); self@IO.out_string("\n"); 0; }}; };