src/Pure/Syntax/mixfix.ML
changeset 12531 adc39b100e9a
parent 12512 ab14b29dfc6d
child 12785 27debaf2112d
equal deleted inserted replaced
12530:c32d201d7c08 12531:adc39b100e9a
    86   | string_of_mixfix (Infixr p) = parens (spaces ["infixr", string_of_int p])
    86   | string_of_mixfix (Infixr p) = parens (spaces ["infixr", string_of_int p])
    87   | string_of_mixfix (Binder (sy, p1, p2)) =
    87   | string_of_mixfix (Binder (sy, p1, p2)) =
    88       parens (spaces ["binder", brackets (string_of_int p1), string_of_int p2]);
    88       parens (spaces ["binder", brackets (string_of_int p1), string_of_int p2]);
    89 
    89 
    90 
    90 
    91 (* type / const names *)
    91 (* syntax specifications *)
    92 
    92 
    93 fun strip ("'" :: c :: cs) = c :: strip cs
    93 fun strip ("'" :: c :: cs) = c :: strip cs
    94   | strip ["'"] = []
    94   | strip ["'"] = []
    95   | strip (c :: cs) = c :: strip cs
    95   | strip (c :: cs) = c :: strip cs
    96   | strip [] = [];
    96   | strip [] = [];
   116 fun fix_mixfix c (Infix p) = (InfixName (c, p))
   116 fun fix_mixfix c (Infix p) = (InfixName (c, p))
   117   | fix_mixfix c (Infixl p) = (InfixlName (c, p))
   117   | fix_mixfix c (Infixl p) = (InfixlName (c, p))
   118   | fix_mixfix c (Infixr p) = (InfixrName (c, p))
   118   | fix_mixfix c (Infixr p) = (InfixrName (c, p))
   119   | fix_mixfix _ mx = mx;
   119   | fix_mixfix _ mx = mx;
   120 
   120 
   121 
       
   122 (* mixfix_args *)
       
   123 
       
   124 fun mixfix_args NoSyn = 0
   121 fun mixfix_args NoSyn = 0
   125   | mixfix_args (Mixfix (sy, _, _)) = SynExt.mfix_args sy
   122   | mixfix_args (Mixfix (sy, _, _)) = SynExt.mfix_args sy
   126   | mixfix_args (Delimfix sy) = SynExt.mfix_args sy
   123   | mixfix_args (Delimfix sy) = SynExt.mfix_args sy
   127   | mixfix_args (*infix or binder*) _ = 2;
   124   | mixfix_args (InfixName (sy, _)) = 2 + SynExt.mfix_args sy
       
   125   | mixfix_args (InfixlName (sy, _)) = 2 + SynExt.mfix_args sy
       
   126   | mixfix_args (InfixrName (sy, _)) = 2 + SynExt.mfix_args sy
       
   127   | mixfix_args (*old infix or binder*) _ = 2;
   128 
   128 
   129 
   129 
   130 (* syn_ext_types *)
   130 (* syn_ext_types *)
   131 
   131 
   132 fun syn_ext_types logtypes type_decls =
   132 fun syn_ext_types logtypes type_decls =