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));