Project

General

Profile

Download (699 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 @param fmt the formatter @param arg the
7
    argument of the pp function **)
8
let pp_lowercase pp fmt =
9
  let str = asprintf "%t" pp in
10
  fprintf fmt "%s" (String.lowercase_ascii str)
11

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

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