Commit a0c8cb05 authored by Pietro Abate's avatar Pietro Abate
Browse files

[r2005-04-18 15:56:16 by afrisch] Empty log message

Original author: afrisch
Date: 2005-04-18 15:56:16+00:00
parent 4df6aa4f
......@@ -157,6 +157,7 @@ and eval_check env t0 e t =
match Explain.explain t0 (Types.descr t) v with
| None -> v
| Some p ->
let p = Explain.simplify p in
let s = print_to_string Explain.print p in
raise (CDuceExn (string_latin1 s))
......
......@@ -143,8 +143,8 @@ and run_disp_record_loop pt fail other rem d =
let is_xml = function Xml _ -> true | _ -> false
let rec prepare = function
| (Absent, _) :: l -> prepare l
let rec simplify = function
| (Absent, _) :: l -> simplify l
| x :: l ->
(try
let y = List.find (function (Xml _,_) -> true | _ -> false) l in
......@@ -163,5 +163,5 @@ let explain t0 t v =
match rhs.(code) with
| Fail ->
(try ignore (run_disp [] code d v); assert false
with Path p -> Some (prepare p))
with Path p -> Some p)
| _ -> None
type t
type t = (Value.t * Types.t Lazy.t) list
val print: Format.formatter -> t -> unit
val to_string: t -> string
val simplify: t -> t
val explain: Types.t -> Types.t -> Value.t -> t option
(** [explain t0 t v]
Return a path on [v] that explains why [v] is not of type [t],
......
......@@ -6,6 +6,7 @@ val any: Types.t
val seqseq: Types.t
val string: Types.t
val string_latin1: Types.t
val char_latin1: Types.t
val any_xtransformable: Types.t
val concat: Types.t -> Types.t -> Types.t
......
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