Project

General

Profile

Download (710 Bytes) Statistics
| Branch: | Tag: | Revision:
1
open Format
2

    
3
type printer = formatter -> unit
4

    
5
(** Encapsulate a pretty print function to lower case its result when applied
6
   @param pp the pretty print function
7
   @param fmt the formatter
8
   @param arg the argument of the pp function
9
**)
10
let pp_lowercase pp fmt =
11
  let str = asprintf "%t" pp in
12
  fprintf fmt "%s" (String. lowercase_ascii str)
13

    
14
(** Print a filename by lowercasing the base and appending an extension.
15
   @param extension the extension to append to the package name
16
   @param fmt the formatter
17
   @param pp_name the file base name printer
18
**)
19
let pp_filename extension fmt pp_name =
20
  fprintf fmt "%t.%s"
21
    (pp_lowercase pp_name)
22
    extension
23

    
24
let pp_str str fmt = fprintf fmt "%s" str
(11-11/11)