Commit 968054b8 authored by Pietro Abate's avatar Pietro Abate
Browse files

Use pp_value instead of Value.print in lambda printer

parent c833c519
......@@ -241,7 +241,7 @@ and pp_lambda ppf =
| Abstraction (va, l, b, i) ->
Format.fprintf ppf "Abstraction(%a,,,,)" pp_vloc_array va
| Check(_) -> Format.fprintf ppf "Check"
| Const(v) -> Format.fprintf ppf "Const(%a)" Value.print v
| Const(v) -> Format.fprintf ppf "Const(%a)" pp_value v
| Pair(e1, e2) -> Format.fprintf ppf "Pair(%a, %a)" pp_lambda e1 pp_lambda e2
| String(_) -> Format.fprintf ppf "String"
| Match(e, brs) -> Format.fprintf ppf "Match(%a, %a)" pp_lambda e pp_lbranches brs
......@@ -256,6 +256,6 @@ and pp_patrhs ppf arr =
let typed_to_string = print_to_string pp_typed
let print_env = Format.printf "%a" pp_env
let print_value = Format.printf "%a" Value.print
let value_to_string = print_to_string Value.print
let print_value = Format.printf "%a" pp_value
let value_to_string = print_to_string pp_value
let lambda_to_string = print_to_string pp_lambda
......@@ -87,10 +87,22 @@ let tests_typer_list = [
"fun f x : ('A | Int) : ('A | Int) -> x",
"fun f (`$A -> `$A) x & Int -> x | x -> x";
"Test CDuce.typed.fun.partial 1",
"fun f x : 'A : 'A -> 2",
"fun f ( `$A -> `$A -> `$A) x -> fun g -> g x";
"Test CDuce.typed.fun.partial 2",
"fun f x : 'A : 'A -> 2",
"fun f ( `$A -> `$A -> `$A) g -> fun (`$A -> `$A) x -> g x";
]
let tests_typer = "CDuce type tests (Ast -> Typed)" >:::
List.map (fun (msg,expected,cduce) -> msg >:: run_test_typer msg expected cduce) tests_typer_list
List.map (fun (msg,expected,cduce) ->
msg >:: run_test_typer msg expected cduce
) tests_typer_list
let _ =
run_test_tt_main (
......
......@@ -32,12 +32,16 @@ let tests_poly_abstr = [
"",
"let x : Int = 3 in x : Int";
"Test CDuce.lambda.identity",
"",
"(fun f x : 'A : 'A -> x)[{A/Int}].2";
*)
"Test CDuce.lambda.identity",
"Test CDuce.runtime.misc.partial",
"",
"(fun f x : 'A : 'A -> x)[{A/Int}].2";
"fun applier x : 'A f : ('A -> 'A) : 'A -> f.x";
(*
"Test CDuce.lambda.apply",
"",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment