X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fcomponents%2Fgrafite_engine%2FgrafiteEngine.ml;h=9817474cddbb50cadea0f5b143d333bb65fdc3ce;hb=a7237500e8a2a4237a6ae8ba4b8301f7bbcb6acb;hp=5d1ea50962f211c333732ebc1fafb1622194b640;hpb=61fdd44c21a3655c3dcea52601c59b31414f8860;p=helm.git diff --git a/helm/software/components/grafite_engine/grafiteEngine.ml b/helm/software/components/grafite_engine/grafiteEngine.ml index 5d1ea5096..9817474cd 100644 --- a/helm/software/components/grafite_engine/grafiteEngine.ml +++ b/helm/software/components/grafite_engine/grafiteEngine.ml @@ -820,24 +820,32 @@ let rec eval_command = {ec_go = fun ~disambiguate_command opts status LibraryObjects.set_default what uris; GrafiteTypes.add_moo_content [cmd] status,`Old [] | GrafiteAst.Drop loc -> raise Drop - | GrafiteAst.Include (loc, _, baseuri) -> - let moopath_rw, moopath_r = - LibraryMisc.obj_file_of_baseuri - ~must_exist:false ~baseuri ~writable:true, - LibraryMisc.obj_file_of_baseuri - ~must_exist:false ~baseuri ~writable:false - in - let moopath = - if Sys.file_exists moopath_r then moopath_r else - if Sys.file_exists moopath_rw then moopath_rw else - raise (IncludedFileNotCompiled (moopath_rw,baseuri)) - in - let status = eval_from_moo.efm_go status moopath in + | GrafiteAst.Include (loc, mode, new_or_old, baseuri) -> + (* Old Include command is not recursive; new one is *) let status = - NRstatus.Serializer.require ~baseuri:(NUri.uri_of_string baseuri) - status + if new_or_old = `OldAndNew then + let moopath_rw, moopath_r = + LibraryMisc.obj_file_of_baseuri + ~must_exist:false ~baseuri ~writable:true, + LibraryMisc.obj_file_of_baseuri + ~must_exist:false ~baseuri ~writable:false in + let moopath = + if Sys.file_exists moopath_r then moopath_r else + if Sys.file_exists moopath_rw then moopath_rw else + raise (IncludedFileNotCompiled (moopath_rw,baseuri)) + in + eval_from_moo.efm_go status moopath + else + status in - status,`Old [] + let status = + NRstatus.Serializer.require ~baseuri:(NUri.uri_of_string baseuri) + status in + let status = + GrafiteTypes.add_moo_content + [GrafiteAst.Include (loc,mode,`New,baseuri)] status + in + status,`Old [] | GrafiteAst.Print (_,"proofterm") -> let _,_,_,p,_, _ = GrafiteTypes.get_current_proof status in prerr_endline (Auto.pp_proofterm (Lazy.force p));