Revision c00d0b42 src/printers.ml
src/printers.ml | ||
---|---|---|
255 | 255 |
pp_node_args ind.nodei_outputs |
256 | 256 |
(fun fmt -> if ind.nodei_stateless then Format.fprintf fmt "stateless") |
257 | 257 |
|
258 |
let pp_const_list fmt clist = |
|
259 |
fprintf_list ~sep:"@ " (fun fmt cdecl -> |
|
260 |
fprintf fmt "%s = %a;" |
|
261 |
cdecl.const_id pp_const cdecl.const_value) fmt clist |
|
262 |
|
|
258 | 263 |
let pp_decl fmt decl = |
259 | 264 |
match decl.top_decl_desc with |
260 | 265 |
| Node nd -> fprintf fmt "%a@ " pp_node nd |
261 | 266 |
| ImportedNode ind -> |
262 | 267 |
fprintf fmt "imported %a;@ " pp_imported_node ind |
263 |
| Consts clist -> ( |
|
264 |
fprintf fmt "const %a@ " |
|
265 |
(fprintf_list ~sep:"@ " (fun fmt cdecl -> |
|
266 |
fprintf fmt "%s = %a;" |
|
267 |
cdecl.const_id pp_const cdecl.const_value)) clist) |
|
268 |
| Open s -> fprintf fmt "open \"%s\"" s |
|
268 |
| Consts clist -> (fprintf fmt "const %a@ " pp_const_list clist) |
|
269 |
| Open (local, s) -> if local then fprintf fmt "open \"%s\"" s else fprintf fmt "open <%s>" s |
|
269 | 270 |
|
270 | 271 |
|
271 | 272 |
let pp_prog fmt prog = |
... | ... | |
275 | 276 |
match decl.top_decl_desc with |
276 | 277 |
| Node nd -> fprintf fmt "node %s@ " nd.node_id |
277 | 278 |
| ImportedNode ind -> fprintf fmt "imported node %s" ind.nodei_id |
278 |
| Consts clist -> ( |
|
279 |
fprintf fmt "const %a@ " |
|
280 |
(fprintf_list ~sep:"@ " (fun fmt cdecl -> |
|
281 |
pp_print_string fmt cdecl.const_id)) clist) |
|
282 |
| Open s -> fprintf fmt "open \"%s\"" s |
|
279 |
| Consts clist -> (fprintf fmt "const %a@ " pp_const_list clist) |
|
280 |
| Open (local, s) -> if local then fprintf fmt "open \"%s\"" s else fprintf fmt "open <%s>" s |
|
283 | 281 |
|
284 | 282 |
let pp_lusi fmt decl = |
285 | 283 |
match decl.top_decl_desc with |
... | ... | |
290 | 288 |
nd.node_id |
291 | 289 |
pp_node_args nd.node_inputs |
292 | 290 |
pp_node_args nd.node_outputs |
293 |
| ImportedNode _ | Consts _ | Open _ -> () |
|
291 |
| Consts clist -> (fprintf fmt "const %a@ " pp_const_list clist) |
|
292 |
| ImportedNode _ | Open _ -> () |
|
294 | 293 |
|
295 | 294 |
|
296 | 295 |
|
Also available in: Unified diff