Project

General

Profile

Revision 94cf0fc5 src/printers.ml

View differences:

src/printers.ml
251 251
and pp_node_eqs fmt eqs = fprintf_list ~sep:"@ " pp_node_eq fmt eqs
252 252

  
253 253
let pp_typedef fmt ty =
254
  fprintf fmt "type %s = %a;@ " ty.tydef_id pp_var_type_dec_desc ty.tydef_desc
254
  fprintf fmt "type %s = %a;" ty.tydef_id pp_var_type_dec_desc ty.tydef_desc
255 255

  
256 256
let pp_typedec fmt ty =
257
  fprintf fmt "type %s;@ " ty.tydec_id
257
  fprintf fmt "type %s;" ty.tydec_id
258 258

  
259 259
(* let rec pp_var_type fmt ty =  *)
260 260
(*   fprintf fmt "%a" (match ty.tdesc with  *)
......
324 324

  
325 325
let pp_decl fmt decl =
326 326
  match decl.top_decl_desc with
327
  | Node nd -> fprintf fmt "%a@ " pp_node nd
327
  | Node nd -> fprintf fmt "%a" pp_node nd
328 328
  | ImportedNode ind ->
329
    fprintf fmt "imported %a;@ " pp_imported_node ind
330
  | Const c -> fprintf fmt "const %a@ " pp_const_decl c
331
  | Open (local, s) -> if local then fprintf fmt "#open \"%s\"@ " s else fprintf fmt "#open <%s>@ " s
332
  | TypeDef tdef -> fprintf fmt "%a@ " pp_typedef tdef
329
    fprintf fmt "imported %a;" pp_imported_node ind
330
  | Const c -> fprintf fmt "const %a" pp_const_decl c
331
  | Open (local, s) -> if local then fprintf fmt "#open \"%s\"" s else fprintf fmt "#open <%s>" s
332
  | TypeDef tdef -> fprintf fmt "%a" pp_typedef tdef
333 333

  
334 334
let pp_prog fmt prog =
335 335
  (* we first print types: the function SortProg.sort could do the job but ut
......
337 337
  let type_decl, others =
338 338
    List.partition (fun decl -> match decl.top_decl_desc with TypeDef _ -> true | _ -> false) prog
339 339
  in
340
  fprintf_list ~sep:"@ " pp_decl fmt (type_decl@others)
340
  fprintf fmt "@[<v 0>%a@]" (fprintf_list ~sep:"@ " pp_decl) (type_decl@others)
341 341

  
342 342
let pp_short_decl fmt decl =
343 343
  match decl.top_decl_desc with

Also available in: Unified diff