X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=matita%2Fmatitac.ml;h=fc1a95e1606aba56cb321cc95a6b6d3289a63cb1;hb=7b05e20cb3ed6be79c2fdf94654047b1e58902f9;hp=34e0639e3aa62ebfd422fb7a02c7a5ac7e5d1d6b;hpb=9642ec8492f2ef54e280e27a40c2936a02c252f9;p=helm.git diff --git a/matita/matitac.ml b/matita/matitac.ml index 34e0639e3..fc1a95e16 100644 --- a/matita/matitac.ml +++ b/matita/matitac.ml @@ -27,6 +27,7 @@ module G = GrafiteAst module L = LexiconAst +module H = HExtlib (* from transcript *) @@ -58,24 +59,27 @@ let pp_ast_statement = (**) let dump f = + let floc = H.dummy_floc in + let nl_ast = G.Comment (floc, G.Note (floc, "")) in let och = open_out f in let atexit () = close_out och in + let nl () = output_string och (pp_ast_statement nl_ast) in let rt_base_dir = Filename.dirname Sys.argv.(0) in let path = Filename.concat rt_base_dir "matita.ma.templ" in let lines = 14 in out_preamble och (path, lines); - let lexicon_engine_cb = function - | L.Include _ as ast -> output_string och (LexiconAstPp.pp_command ast) - | _ -> () + let grafite_parser_cb fname = + let ast = G.Executable (floc, G.Command (floc, G.Include (floc, fname))) in + output_string och (pp_ast_statement ast); nl (); nl () in let matita_engine_cb = function | G.Executable (_, G.Macro (_, G.Inline _)) | G.Executable (_, G.Command (_, G.Include _)) -> () - | ast -> - output_string och (pp_ast_statement ast) + | ast -> + output_string och (pp_ast_statement ast); nl (); nl () in let matitac_lib_cb = output_string och in - LexiconEngine.set_callback lexicon_engine_cb; + GrafiteParser.set_callback grafite_parser_cb; MatitaEngine.set_callback matita_engine_cb; MatitacLib.set_callback matitac_lib_cb; at_exit atexit