in
((new_grafite_status,new_lexicon_status),None)::intermediate_states
-let eval_from_stream ~include_paths ?(prompt=false) ?do_heavy_checks
- ?clean_baseuri lexicon_status grafite_status str cb
+let eval_from_stream ~first_statement_only ~include_paths ?(prompt=false)
+ ?do_heavy_checks ?clean_baseuri 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
+ else
+ loop
+ in
if prompt then (print_string "matita> "; flush stdout);
try
let lexicon_status,ast =
loop lexicon_status grafite_status []
;;
-let eval_string ~include_paths ?do_heavy_checks ?clean_baseuri lexicon_status
- status str
+let eval_string ~first_statement_only ~include_paths ?do_heavy_checks
+ ?clean_baseuri lexicon_status status str
=
- eval_from_stream ~include_paths ?do_heavy_checks ?clean_baseuri lexicon_status
- status (Ulexing.from_utf8_string str) (fun _ _ -> ())
+ eval_from_stream ~first_statement_only ~include_paths ?do_heavy_checks
+ ?clean_baseuri lexicon_status status (Ulexing.from_utf8_string str)
+ (fun _ _ -> ())
(* heavy checks slow down the compilation process but give you some interesting
* infos like if the theorem is a duplicate *)
val eval_string :
+ first_statement_only:bool ->
include_paths:string list ->
?do_heavy_checks:bool ->
?clean_baseuri:bool ->
) list
val eval_from_stream :
+ first_statement_only:bool ->
include_paths:string list ->
?prompt:bool ->
?do_heavy_checks:bool ->
let str = Ulexing.from_utf8_channel stdin in
try
run_script str
- (MatitaEngine.eval_from_stream ~prompt:true
+ (MatitaEngine.eval_from_stream ~first_statement_only:false ~prompt:true
~include_paths:(Helm_registry.get_list Helm_registry.string
"matita.includes"))
with
Helm_registry.get_list Helm_registry.string "matita.includes" in
(try
run_script is
- (MatitaEngine.eval_from_stream ~include_paths
+ (MatitaEngine.eval_from_stream ~first_statement_only:false ~include_paths
~clean_baseuri:(not (Helm_registry.get_bool "matita.preserve")))
with End_of_file -> ());
let elapsed = Unix.time () -. time in