| `Type_checking_failed s ->
decr indent;
if debug then
- prerr_endline (do_indent () ^ "Fail: " ^ NUri.string_of_uri s))
+ prerr_endline (do_indent () ^ "Fail: " ^ NUri.string_of_uri s)
+ | `Trust_obj s ->
+ if debug then
+ prerr_endline (do_indent () ^ "Trust: " ^ NUri.string_of_uri s))
;;
let _ =
) fl dfl
;;
+(* trust *)
+
+let trust = ref (fun _ -> true);;
+let set_trust f = trust := f
+let trust_obj obj = !trust obj
+
+
(* web interface stuff *)
let logger =
- ref (function (`Start_type_checking _|`Type_checking_completed _|`Type_checking_interrupted _|`Type_checking_failed _) -> ())
+ ref (function (`Start_type_checking _|`Type_checking_completed _|`Type_checking_interrupted _|`Type_checking_failed _|`Trust_obj _) -> ())
;;
let set_logger f = logger := f;;
raise e
;;
-E.set_typecheck_obj typecheck_obj;;
+E.set_typecheck_obj
+ (fun obj ->
+ if trust_obj obj then
+ let u,_,_,_,_ = obj in
+ !logger (`Trust_obj u)
+ else
+ typecheck_obj obj)
+;;
(* EOF *)
| `Type_checking_completed of NUri.uri
| `Type_checking_interrupted of NUri.uri
| `Type_checking_failed of NUri.uri
+ | `Trust_obj of NUri.uri
] -> unit) -> unit
+val set_trust : (NCic.obj -> bool) -> unit
+
(* typechecks the object, raising an exception if illtyped *)
val typecheck_obj : NCic.obj -> unit