exception Drop
(* mo file name, ma file name *)
-(*exception IncludedFileNotCompiled of string * string *)
exception NMacro of GrafiteAst.loc * GrafiteAst.nmacro
type 'a disambiguator_input = string * int * 'a
let status,uris =
match cmd with
| GrafiteAst.Include (loc, baseuri) ->
- (*
- let status =
- 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 status moopath
- in
- let status = *)
NCicLibrary.Serializer.require ~baseuri:(NUri.uri_of_string baseuri)
- status (*in
- let status =
- GrafiteTypes.add_moo_content
- [GrafiteAst.Include (loc,baseuri)] status
- in
- status,[] *), []
+ status, []
| GrafiteAst.Print (_,_) -> status,[]
| GrafiteAst.Set (loc, name, value) -> status, []
in
| GrafiteAst.NMacro (loc, macro) ->
raise (NMacro (loc,macro))
-and eval_from_moo status fname =
- let ast_of_cmd cmd =
- ("",0,GrafiteAst.Executable (HExtlib.dummy_floc,
- GrafiteAst.Command (HExtlib.dummy_floc,
- cmd)))
- in
- let moo = GrafiteMarshal.load_moo fname in
- List.fold_left
- (fun status ast ->
- let ast = ast_of_cmd ast in
- let status,lemmas =
- eval_ast ~disambiguate_command:(fun status (_,_,cmd) -> status,cmd)
- status ast
- in
- assert (lemmas=[]);
- status)
- status moo
-
and eval_ast ~disambiguate_command ?(do_heavy_checks=false) status
(text,prefix_len,st)
=