X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;ds=sidebyside;f=matita%2Fmatita%2FmatitaEngine.ml;h=43a09d2a6e50cd329592086ea0eefe28a6976a12;hb=939dfce0cb12f7e7760a24d89f6812890b9df431;hp=429f75cd371806755c0cafd1bdf00044bdfbf7fa;hpb=a7ed0b694086ba14b337c82b82f02f7be16c680f;p=helm.git diff --git a/matita/matita/matitaEngine.ml b/matita/matita/matitaEngine.ml index 429f75cd3..43a09d2a6 100644 --- a/matita/matita/matitaEngine.ml +++ b/matita/matita/matitaEngine.ml @@ -86,16 +86,11 @@ let eval_ast ~include_paths ?do_heavy_checks status (text,prefix_len,ast) = exception TryingToAdd of string exception EnrichedWithStatus of exn * GrafiteTypes.status -let eval_from_stream ~first_statement_only ~include_paths - ?do_heavy_checks ?(enforce_no_new_aliases=true) - ?(watch_statuses=fun _ -> ()) status str cb +let eval_from_stream ~include_paths ?do_heavy_checks + ?(enforce_no_new_aliases=true) status str cb = let matita_debug = Helm_registry.get_bool "matita.debug" in let rec loop status statuses = - let loop = - if first_statement_only then fun _ statuses -> statuses - else loop - in let stop,g,s = try let cont = @@ -104,29 +99,23 @@ let eval_from_stream ~first_statement_only ~include_paths match cont with | None -> true, status, statuses | Some ast -> - (match ast with - GrafiteParser.LNone _ -> - watch_statuses status ; - false, status, ((status,None)::statuses) - | GrafiteParser.LSome ast -> - cb status ast; - let new_statuses = - eval_ast ~include_paths ?do_heavy_checks status ("",0,ast) in - if enforce_no_new_aliases then - List.iter - (fun (_,alias) -> - match alias with - None -> () - | Some (k,value) -> - let newtxt = GrafiteAstPp.pp_alias value in - raise (TryingToAdd newtxt)) new_statuses; - let status = - match new_statuses with - [] -> assert false - | (s,_)::_ -> s - in - watch_statuses status ; - false, status, (new_statuses @ statuses)) + cb status ast; + let new_statuses = + eval_ast ~include_paths ?do_heavy_checks status ("",0,ast) in + if enforce_no_new_aliases then + List.iter + (fun (_,alias) -> + match alias with + None -> () + | Some (k,value) -> + let newtxt = GrafiteAstPp.pp_alias value in + raise (TryingToAdd newtxt)) new_statuses; + let status = + match new_statuses with + [] -> assert false + | (s,_)::_ -> s + in + false, status, (new_statuses @ statuses) with exn when not matita_debug -> raise (EnrichedWithStatus (exn, status)) in