Project

General

Profile

Revision aa223e69 src/printers.ml

View differences:

src/printers.ml
40 40

  
41 41
let pp_eq_lhs = fprintf_list ~sep:", " pp_print_string
42 42

  
43
let rec pp_const fmt c = 
43
let rec pp_struct_const_field fmt (label, c) =
44
  fprintf fmt "%a = %a;" pp_print_string label pp_const c
45
and pp_const fmt c = 
44 46
  match c with
45 47
    | Const_int i -> pp_print_int fmt i
46 48
    | Const_real r -> pp_print_string fmt r
47 49
    | Const_float r -> pp_print_float fmt r
48 50
    | Const_tag  t -> pp_print_string fmt t
49 51
    | Const_array ca -> Format.fprintf fmt "[%a]" (Utils.fprintf_list ~sep:"," pp_const) ca
52
    | Const_struct fl -> Format.fprintf fmt "{%a }" (Utils.fprintf_list ~sep:" " pp_struct_const_field) fl
50 53

  
51 54
and pp_var fmt id = fprintf fmt "%s%s: %a" (if id.var_dec_const then "const " else "") id.var_id Types.print_ty id.var_type
52 55

  

Also available in: Unified diff