]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/matita/matitaEngine.ml
1. buf fixed in eval_from_stream when first_statemente_only=true:
[helm.git] / helm / software / matita / matitaEngine.ml
index 9d88777ac1b97b68fee16039d39aa7dcd32d9847..9778f09007d0e88a8c99dfffb8c2afd87e875a48 100644 (file)
@@ -102,12 +102,12 @@ exception TryingToAdd of string
 
 let eval_from_stream ~first_statement_only ~include_paths ?(prompt=false)
  ?do_heavy_checks ?clean_baseuri ?(enforce_no_new_aliases=true)
- lexicon_status grafite_status str cb 
?(watch_statuses=fun _ _ -> ()) lexicon_status grafite_status str cb 
 =
  let rec loop lexicon_status grafite_status statuses =
   let loop =
    if first_statement_only then
-    fun _ _ _ -> raise End_of_file
+    fun _ _ statuses -> statuses
    else
     loop
   in
@@ -118,6 +118,7 @@ let eval_from_stream ~first_statement_only ~include_paths ?(prompt=false)
     in
      (match ast with
          GrafiteParser.LNone _ ->
+          watch_statuses lexicon_status grafite_status ;
           loop lexicon_status grafite_status
            (((grafite_status,lexicon_status),None)::statuses)
        | GrafiteParser.LSome ast ->
@@ -142,6 +143,7 @@ let eval_from_stream ~first_statement_only ~include_paths ?(prompt=false)
               [] -> assert false
             | (s,_)::_ -> s
           in
+           watch_statuses lexicon_status grafite_status ;
            loop lexicon_status grafite_status (new_statuses @ statuses))
    with
     End_of_file -> statuses