]> matita.cs.unibo.it Git - helm.git/blobdiff - matita/matitacLib.ml
Debugging code fixed. To enable debugging just set debug to true at the
[helm.git] / matita / matitacLib.ml
index ba9af1302402450a390e7f4bb0f7f2b5ae5d6b0d..52ad776e71d3a2fe91a07c5107b28dea21baa3ff 100644 (file)
@@ -31,6 +31,10 @@ open GrafiteTypes
 
 exception AttemptToInsertAnAlias
 
+let out = ref ignore 
+
+let set_callback f = out := f
+
 let pp_ast_statement =
   GrafiteAstPp.pp_statement ~term_pp:CicNotationPp.pp_term
     ~lazy_term_pp:CicNotationPp.pp_term ~obj_pp:(CicNotationPp.pp_obj CicNotationPp.pp_term)
@@ -126,8 +130,14 @@ let rec interactive_loop () =
         "matita.includes"))
   with 
   | GrafiteEngine.Drop -> pp_ocaml_mode ()
-  | GrafiteEngine.Macro (floc,_) ->
-     let x, y = HExtlib.loc_of_floc floc in
+  | GrafiteEngine.Macro (floc, f) ->
+      begin match snd (f []) with 
+       | GrafiteAst.Inline (_, style, suri, prefix) ->
+         let str = ApplyTransformation.txt_of_inline_macro style suri prefix in
+         !out str
+       | _ -> ()
+      end;
+      let x, y = HExtlib.loc_of_floc floc in
       HLog.error
        (sprintf "A macro has been found in a script at %d-%d" x y);
       interactive_loop ()