src/Pure/Syntax/printer.ML
changeset 2210 8369f3f4bb4f
parent 2200 2538977e94fa
child 2229 64acb485ecce
equal deleted inserted replaced
2209:e10e02de3e02 2210:8369f3f4bb4f
   285         (case trf a of
   285         (case trf a of
   286           None => prnt (get_fmts tabs a)
   286           None => prnt (get_fmts tabs a)
   287         | Some f => (astT (trans a f args, p) handle Match => prnt (get_fmts tabs a)))
   287         | Some f => (astT (trans a f args, p) handle Match => prnt (get_fmts tabs a)))
   288       end
   288       end
   289 
   289 
   290 (* FIXME old
       
   291     and combT (tup as (c, a, args, p)) =
       
   292       let
       
   293         val nargs = length args;
       
   294 
       
   295         fun prnt (pr, n, p') =
       
   296           if nargs = n then parT (pr, args, p, p')
       
   297           else if nargs < n orelse type_mode then prefixT tup
       
   298           else astT (appT (splitT n ([c], args)), p);
       
   299       in
       
   300         (case (trf a, get_fmt tabs a) of
       
   301           (None, None) => prefixT tup
       
   302         | (None, Some prnp) => prnt prnp
       
   303         | (Some f, None) =>
       
   304             (astT (trans a f args, p) handle Match => prefixT tup)
       
   305         | (Some f, Some prnp) =>
       
   306             (astT (trans a f args, p) handle Match => prnt prnp))
       
   307       end
       
   308 *)
       
   309 
       
   310     and astT (c as Constant a, p) = combT (c, a, [], p)
   290     and astT (c as Constant a, p) = combT (c, a, [], p)
   311       | astT (Variable x, _) = [Pretty.str x]
   291       | astT (Variable x, _) = [Pretty.str x]
   312       | astT (Appl ((c as Constant a) :: (args as _ :: _)), p) =
   292       | astT (Appl ((c as Constant a) :: (args as _ :: _)), p) =
   313           combT (c, a, args, p)
   293           combT (c, a, args, p)
   314       | astT (Appl (f :: (args as _ :: _)), p) = astT (appT (f, args), p)
   294       | astT (Appl (f :: (args as _ :: _)), p) = astT (appT (f, args), p)