k
else if are_empty t then
let res = match_cb (matched t) in
- (fun matched_terms _ -> res matched_terms)
+ (fun matched_terms terms ->
+ match res matched_terms with
+ None ->
+ begin
+ (* the match has failed, we rollback the last matched term
+ * into the unmatched ones and call the failure continuation
+ *)
+ match matched_terms with
+ hd :: tl -> k tl (hd :: terms)
+ | _ -> assert false
+ end
+ | Some v -> Some v)
else
match horizontal_split t with
| _, [], _ -> assert false
(fun term env ->
prerr_endline "GUARDIA?" ;
match compiled_guard term with
- | None ->
- prerr_endline "SONO CAZZI H2SO4" ;
- None
+ | None -> None
| Some _ ->
begin
- prerr_endline "OKKKKKKKKKKKKKK" ;
match compiled_p term with
| None -> None
| Some (env', _) ->