Project

General

Profile

Revision 66359a5e src/printers.ml

View differences:

src/printers.ml
80 80
    | Const_string s -> pp_print_string fmt ("\"" ^ s ^ "\"")
81 81

  
82 82

  
83
let pp_annot_key fmt kwds =
84
  match kwds with
85
  | [] -> assert false
86
  | [x] -> Format.pp_print_string fmt x
87
  | _ -> Format.fprintf fmt "/%a/" (fprintf_list ~sep:"/" Format.pp_print_string) kwds
88

  
83 89
let rec pp_expr fmt expr =
84 90
  (match expr.expr_annot with 
85 91
  | None -> fprintf fmt "%t" 
......
164 170

  
165 171
and pp_expr_annot fmt expr_ann =
166 172
  let pp_annot fmt (kwds, ee) =
167
    Format.fprintf fmt "(*! %t: %a; *)"
168
      (fun fmt -> match kwds with | [] -> assert false | [x] -> Format.pp_print_string fmt x | _ -> Format.fprintf fmt "/%a/" (fprintf_list ~sep:"/" Format.pp_print_string) kwds)
173
    Format.fprintf fmt "(*! %a: %a; *)"
174
      pp_annot_key kwds
169 175
      pp_eexpr ee
170 176
  in
171 177
  fprintf_list ~sep:"@ " pp_annot fmt expr_ann.annots

Also available in: Unified diff