src/Pure/Syntax/mixfix.ML
changeset 35130 0991c84e8dcf
parent 35129 ed24ba6f69aa
child 35351 7425aece4ee3
     1.1 --- a/src/Pure/Syntax/mixfix.ML	Mon Feb 15 17:17:51 2010 +0100
     1.2 +++ b/src/Pure/Syntax/mixfix.ML	Mon Feb 15 18:03:42 2010 +0100
     1.3 @@ -10,9 +10,9 @@
     1.4      NoSyn |
     1.5      Mixfix of string * int list * int |
     1.6      Delimfix of string |
     1.7 -    InfixName of string * int |
     1.8 -    InfixlName of string * int |
     1.9 -    InfixrName of string * int |
    1.10 +    Infix of string * int |
    1.11 +    Infixl of string * int |
    1.12 +    Infixr of string * int |
    1.13      Binder of string * int * int |
    1.14      Structure
    1.15    val binder_name: string -> string
    1.16 @@ -45,9 +45,9 @@
    1.17    NoSyn |
    1.18    Mixfix of string * int list * int |
    1.19    Delimfix of string |
    1.20 -  InfixName of string * int |
    1.21 -  InfixlName of string * int |
    1.22 -  InfixrName of string * int |
    1.23 +  Infix of string * int |
    1.24 +  Infixl of string * int |
    1.25 +  Infixr of string * int |
    1.26    Binder of string * int * int |
    1.27    Structure;
    1.28  
    1.29 @@ -72,9 +72,9 @@
    1.30    | pretty_mixfix (Mixfix (s, ps, p)) =
    1.31        parens (Pretty.breaks [quoted s, brackets (Pretty.commas (map int ps)), int p])
    1.32    | pretty_mixfix (Delimfix s) = parens [quoted s]
    1.33 -  | pretty_mixfix (InfixName (s, p)) = parens (Pretty.breaks [keyword "infix", quoted s, int p])
    1.34 -  | pretty_mixfix (InfixlName (s, p)) = parens (Pretty.breaks [keyword "infixl", quoted s, int p])
    1.35 -  | pretty_mixfix (InfixrName (s, p)) = parens (Pretty.breaks [keyword "infixl", quoted s, int p])
    1.36 +  | pretty_mixfix (Infix (s, p)) = parens (Pretty.breaks [keyword "infix", quoted s, int p])
    1.37 +  | pretty_mixfix (Infixl (s, p)) = parens (Pretty.breaks [keyword "infixl", quoted s, int p])
    1.38 +  | pretty_mixfix (Infixr (s, p)) = parens (Pretty.breaks [keyword "infixl", quoted s, int p])
    1.39    | pretty_mixfix (Binder (s, p1, p2)) =
    1.40        parens (Pretty.breaks [keyword "binder", quoted s, brackets [int p1], int p2])
    1.41    | pretty_mixfix Structure = parens [keyword "structure"];
    1.42 @@ -87,9 +87,9 @@
    1.43  fun mixfix_args NoSyn = 0
    1.44    | mixfix_args (Mixfix (sy, _, _)) = SynExt.mfix_args sy
    1.45    | mixfix_args (Delimfix sy) = SynExt.mfix_args sy
    1.46 -  | mixfix_args (InfixName (sy, _)) = 2 + SynExt.mfix_args sy
    1.47 -  | mixfix_args (InfixlName (sy, _)) = 2 + SynExt.mfix_args sy
    1.48 -  | mixfix_args (InfixrName (sy, _)) = 2 + SynExt.mfix_args sy
    1.49 +  | mixfix_args (Infix (sy, _)) = 2 + SynExt.mfix_args sy
    1.50 +  | mixfix_args (Infixl (sy, _)) = 2 + SynExt.mfix_args sy
    1.51 +  | mixfix_args (Infixr (sy, _)) = 2 + SynExt.mfix_args sy
    1.52    | mixfix_args (Binder _) = 1
    1.53    | mixfix_args Structure = 0;
    1.54  
    1.55 @@ -106,9 +106,9 @@
    1.56          [SynExt.typeT, SynExt.typeT] ---> SynExt.typeT, t, [p1, p2], p3);
    1.57  
    1.58      fun mfix_of (_, _, NoSyn) = NONE
    1.59 -      | mfix_of (t, 2, InfixName (sy, p)) = SOME (mk_infix sy t (p + 1) (p + 1) p)
    1.60 -      | mfix_of (t, 2, InfixlName (sy, p)) = SOME (mk_infix sy t p (p + 1) p)
    1.61 -      | mfix_of (t, 2, InfixrName (sy, p)) = SOME (mk_infix sy t (p + 1) p p)
    1.62 +      | mfix_of (t, 2, Infix (sy, p)) = SOME (mk_infix sy t (p + 1) (p + 1) p)
    1.63 +      | mfix_of (t, 2, Infixl (sy, p)) = SOME (mk_infix sy t p (p + 1) p)
    1.64 +      | mfix_of (t, 2, Infixr (sy, p)) = SOME (mk_infix sy t (p + 1) p p)
    1.65        | mfix_of (t, _, _) =
    1.66            error ("Bad mixfix declaration for type: " ^ quote t);  (* FIXME printable!? *)
    1.67  
    1.68 @@ -135,9 +135,9 @@
    1.69      fun mfix_of (_, _, NoSyn) = []
    1.70        | mfix_of (c, ty, Mixfix (sy, ps, p)) = [SynExt.Mfix (sy, ty, c, ps, p)]
    1.71        | mfix_of (c, ty, Delimfix sy) = [SynExt.Mfix (sy, ty, c, [], SynExt.max_pri)]
    1.72 -      | mfix_of (c, ty, InfixName (sy, p)) = mk_infix sy ty c (p + 1) (p + 1) p
    1.73 -      | mfix_of (c, ty, InfixlName (sy, p)) = mk_infix sy ty c p (p + 1) p
    1.74 -      | mfix_of (c, ty, InfixrName (sy, p)) = mk_infix sy ty c (p + 1) p p
    1.75 +      | mfix_of (c, ty, Infix (sy, p)) = mk_infix sy ty c (p + 1) (p + 1) p
    1.76 +      | mfix_of (c, ty, Infixl (sy, p)) = mk_infix sy ty c p (p + 1) p
    1.77 +      | mfix_of (c, ty, Infixr (sy, p)) = mk_infix sy ty c (p + 1) p p
    1.78        | mfix_of (c, ty, Binder (sy, p, q)) =
    1.79            [SynExt.Mfix ("(3" ^ sy ^ "_./ _)", binder_typ c ty, (binder_name c), [0, p], q)]
    1.80        | mfix_of (c, _, _) = error ("Bad mixfix declaration for const: " ^ quote c);