added unlocalize_mfix;
authorwenzelm
Wed, 04 Jan 2006 00:52:49 +0100
changeset 18566 20dd2f7dca4b
parent 18565 818a24371de9
child 18567 ecdd71518f33
added unlocalize_mfix;
src/Pure/Syntax/syn_ext.ML
--- a/src/Pure/Syntax/syn_ext.ML	Wed Jan 04 00:52:48 2006 +0100
+++ b/src/Pure/Syntax/syn_ext.ML	Wed Jan 04 00:52:49 2006 +0100
@@ -51,6 +51,7 @@
       token_translation: (string * string * (string -> string * real)) list}
   val mfix_args: string -> int
   val escape_mfix: string -> string
+  val unlocalize_mfix: string -> string
   val syn_ext': bool -> (string -> bool) -> mfix list ->
     string list -> (string * ((theory -> Ast.ast list -> Ast.ast) * stamp)) list *
     (string * ((theory -> term list -> term) * stamp)) list *
@@ -232,6 +233,14 @@
   val escape_mfix = implode o map (fn s => if is_meta s then "'" ^ s else s) o Symbol.explode;
 end;
 
+val unlocalize_mfix =
+  let
+    fun unloc ("'" :: "\\<^loc>" :: ss) = unloc ss
+      | unloc ("\\<^loc>" :: ss) = unloc ss
+      | unloc (s :: ss) = s :: unloc ss
+      | unloc [] = [];
+  in Symbol.explode #> unloc #> implode end;  
+
 
 (* mfix_to_xprod *)