refined unlocalize_mixfix;
authorwenzelm
Sat, 07 Oct 2006 01:31:20 +0200
changeset 20892 318f0ff93d99
parent 20891 5dc02e7880be
child 20893 c99f79910ae8
refined unlocalize_mixfix;
src/Pure/Syntax/mixfix.ML
src/Pure/Tools/class_package.ML
--- a/src/Pure/Syntax/mixfix.ML	Sat Oct 07 01:31:19 2006 +0200
+++ b/src/Pure/Syntax/mixfix.ML	Sat Oct 07 01:31:20 2006 +0200
@@ -30,7 +30,7 @@
   val type_name: string -> mixfix -> string
   val const_name: string -> mixfix -> string
   val const_mixfix: string -> mixfix -> string * mixfix
-  val unlocalize_mixfix: mixfix -> mixfix
+  val unlocalize_mixfix: bool -> mixfix -> mixfix
   val mixfix_args: mixfix -> int
 end;
 
@@ -138,9 +138,9 @@
   | map_mixfix _ Structure = Structure
   | map_mixfix _ _ = raise Fail ("map_mixfix: illegal occurrence of unnamed infix");
 
-fun unlocalize_mixfix mx =
+fun unlocalize_mixfix loc mx =
   let val mx' = map_mixfix SynExt.unlocalize_mfix mx
-  in if mx = mx' then NoSyn else mx' end;
+  in if mx = mx' andalso loc then NoSyn else mx' end;
 
 fun mixfix_args NoSyn = 0
   | mixfix_args (Mixfix (sy, _, _)) = SynExt.mfix_args sy
--- a/src/Pure/Tools/class_package.ML	Sat Oct 07 01:31:19 2006 +0200
+++ b/src/Pure/Tools/class_package.ML	Sat Oct 07 01:31:20 2006 +0200
@@ -285,7 +285,7 @@
             | _ => error ("More than one type variable in type signature of constant " ^ quote c));
         val consts1 =
           Locale.parameters_of thy name_locale
-          |> map (apsnd Syntax.unlocalize_mixfix)
+          |> map (apsnd (Syntax.unlocalize_mixfix true))
         val SOME v = fold extract_classvar consts1 NONE;
         val consts2 = map ((apfst o apsnd) (subst_clsvar v (TFree (v, [])))) consts1;
       in (v, chop (length mapp_sup) consts2) end;