src/Tools/Code/code_printer.ML
changeset 38922 ec2a8efd8990
parent 38911 caba168a3039
child 38923 79d7f2b4cf71
equal deleted inserted replaced
38921:15f8cffdbf5d 38922:ec2a8efd8990
    66   val APP: fixity
    66   val APP: fixity
    67   val brackify: fixity -> Pretty.T list -> Pretty.T
    67   val brackify: fixity -> Pretty.T list -> Pretty.T
    68   val brackify_infix: int * lrx -> fixity -> Pretty.T * Pretty.T * Pretty.T -> Pretty.T
    68   val brackify_infix: int * lrx -> fixity -> Pretty.T * Pretty.T * Pretty.T -> Pretty.T
    69   val brackify_block: fixity -> Pretty.T -> Pretty.T list -> Pretty.T -> Pretty.T
    69   val brackify_block: fixity -> Pretty.T -> Pretty.T list -> Pretty.T -> Pretty.T
    70   val applify: string -> string -> ('a -> Pretty.T) -> fixity -> Pretty.T -> 'a list -> Pretty.T
    70   val applify: string -> string -> ('a -> Pretty.T) -> fixity -> Pretty.T -> 'a list -> Pretty.T
       
    71   val tuplify: (fixity -> 'a -> Pretty.T) -> fixity -> 'a list -> Pretty.T option
       
    72 
    71 
    73 
    72   type tyco_syntax
    74   type tyco_syntax
    73   type simple_const_syntax
    75   type simple_const_syntax
    74   type complex_const_syntax
    76   type complex_const_syntax
    75   type const_syntax
    77   type const_syntax
   242 fun applify opn cls f fxy_ctxt p [] = p
   244 fun applify opn cls f fxy_ctxt p [] = p
   243   | applify opn cls f fxy_ctxt p ps =
   245   | applify opn cls f fxy_ctxt p ps =
   244       (if (fixity BR fxy_ctxt) then enclose "(" ")" else Pretty.block)
   246       (if (fixity BR fxy_ctxt) then enclose "(" ")" else Pretty.block)
   245         (p @@ enum "," opn cls (map f ps));
   247         (p @@ enum "," opn cls (map f ps));
   246 
   248 
       
   249 fun tuplify _ _ [] = NONE
       
   250   | tuplify print fxy [x] = SOME (print fxy x)
       
   251   | tuplify print _ xs = SOME (enum "," "(" ")" (map (print NOBR) xs));
       
   252 
   247 
   253 
   248 (* generic syntax *)
   254 (* generic syntax *)
   249 
   255 
   250 type tyco_syntax = int * ((fixity -> itype -> Pretty.T)
   256 type tyco_syntax = int * ((fixity -> itype -> Pretty.T)
   251   -> fixity -> itype list -> Pretty.T);
   257   -> fixity -> itype list -> Pretty.T);