]> matita.cs.unibo.it Git - helm.git/blobdiff - components/syntax_extensions/pa_unicode_macro.ml
snapshot for camlp5 v5
[helm.git] / components / syntax_extensions / pa_unicode_macro.ml
index dda7d4cabc852161144df5a893c1dfc253985d0e..a0051edfc9290491239f7407305ffaa2edd1e3fa 100644 (file)
 let debug = false
 let debug_print s = if debug then prerr_endline (Lazy.force s)
 
-let loc =
-  let dummy_pos =
-    { Lexing.pos_fname = ""; Lexing.pos_lnum = -1; Lexing.pos_bol = -1;
-      Lexing.pos_cnum = -1 }
-  in
-  (dummy_pos, dummy_pos)
+let loc = Stdpp.make_loc (-1, -1)
 
 let expand_unicode_macro macro =
   debug_print (lazy (Printf.sprintf "Expanding macro '%s' ..." macro));
@@ -56,9 +51,12 @@ EXTEND
            String.sub q (pos + 1) (String.length q - pos - 1))
         in
         debug_print (lazy (Printf.sprintf "QUOTATION = %s; ARG = %s" quotation arg));
-        if quotation = "unicode" then
+        if quotation = "unicode" then 
+          AStok (loc, x, Some (ATexpr (loc, expand_unicode_macro arg)))
+(*
           let text = TXtok (loc, x, expand_unicode_macro arg) in
           {used = []; text = text; styp = STlid (loc, "string")}
+*)
         else
           assert false
       ]