src/Pure/Syntax/mixfix.ML
changeset 887 6a054d83acb2
parent 865 b38c67991122
child 921 6bee3815c0bf
equal deleted inserted replaced
886:9af08725600b 887:6a054d83acb2
    50   NoSyn |
    50   NoSyn |
    51   Mixfix of string * int list * int |
    51   Mixfix of string * int list * int |
    52   Delimfix of string |
    52   Delimfix of string |
    53   Infixl of int |
    53   Infixl of int |
    54   Infixr of int |
    54   Infixr of int |
    55   Binder of string * int * int
    55   Binder of string * int * int;
    56 
    56 
    57 
    57 
    58 (* type / const names *)
    58 (* type / const names *)
    59 
    59 
    60 fun strip ("'" :: c :: cs) = c :: strip cs
    60 fun strip ("'" :: c :: cs) = c :: strip cs
   116     fun mfix_of (_, _, NoSyn) = []
   116     fun mfix_of (_, _, NoSyn) = []
   117       | mfix_of (c, ty, Mixfix (sy, ps, p)) = [Mfix (sy, ty, c, ps, p)]
   117       | mfix_of (c, ty, Mixfix (sy, ps, p)) = [Mfix (sy, ty, c, ps, p)]
   118       | mfix_of (c, ty, Delimfix sy) = [Mfix (sy, ty, c, [], max_pri)]
   118       | mfix_of (c, ty, Delimfix sy) = [Mfix (sy, ty, c, [], max_pri)]
   119       | mfix_of (sy, ty, Infixl p) = mk_infix sy ty (infix_name sy) p (p + 1) p
   119       | mfix_of (sy, ty, Infixl p) = mk_infix sy ty (infix_name sy) p (p + 1) p
   120       | mfix_of (sy, ty, Infixr p) = mk_infix sy ty (infix_name sy) (p + 1) p p
   120       | mfix_of (sy, ty, Infixr p) = mk_infix sy ty (infix_name sy) (p + 1) p p
   121       | mfix_of (c, ty, Binder (sy, p2, p)) =
   121       | mfix_of (c, ty, Binder (sy, p, q)) =
   122           [Mfix ("(3" ^ sy ^ "_./ _)", binder_typ c ty, sy, [0, p2], p)];
   122           [Mfix ("(3" ^ sy ^ "_./ _)", binder_typ c ty, sy, [0, p], q)];
   123 
   123 
   124     fun binder (c, _, Binder (sy, _, _)) = Some (sy, c)
   124     fun binder (c, _, Binder (sy, _, _)) = Some (sy, c)
   125       | binder _ = None;
   125       | binder _ = None;
   126 
   126 
   127     val mfix = flat (map mfix_of const_decls);
   127     val mfix = flat (map mfix_of const_decls);