parser
[< s = list p_stmt >] ->
s
- | [< xs = many1 expr >] ->
- match xs with
- [x] ->
- ClosTrans.Plain (Ast.Expr x)
- | xs ->
- ClosTrans.Plain (Ast.Expr (Ast.Block xs))
+ | [< x = expr >] ->
+ ClosTrans.Plain (Ast.Expr x)
let compile stream =
try
Lisp.compile_string "(define x 42)";
ok [Plain (Define (node "f",Lambda ([node "x"],Block [int 42])))] @@
Lisp.compile_string "(define (f x) 42)");
+ "bug()" >::
+ (fun () ->
+ ok [Plain (Expr (int 10));
+ Plain (Define (node "x",Block [int 42]))] @@
+ Lisp.compile_string "10 (define x 42)");
"class" >::
(fun () ->
ok [define_class "Foo" ("","Object") ["x";"y"]] @@