Revision 52cfee34 src/printers.ml
src/printers.ml | ||
---|---|---|
224 | 224 |
() |
225 | 225 |
|
226 | 226 |
let pp_node fmt nd = |
227 |
fprintf fmt "@[<v 0>%a%tnode %s (%a) returns (%a)@.%a%alet@.@[<h 2> @ @[%a@]@ @]@.tel@]@."
|
|
227 |
fprintf fmt "@[<v 0>%a%t%s %s (%a) returns (%a)@.%a%alet@.@[<h 2> @ @[%a@]@ @]@.tel@]@."
|
|
228 | 228 |
(fun fmt s -> match s with Some s -> pp_spec fmt s | _ -> ()) nd.node_spec |
229 |
(fun fmt -> match nd.node_spec with None -> () | Some _ -> Format.fprintf fmt "@.") |
|
229 |
(fun fmt -> match nd.node_spec with None -> () | Some _ -> Format.fprintf fmt "@.") |
|
230 |
(if nd.node_dec_stateless then "function" else "node") |
|
230 | 231 |
nd.node_id |
231 | 232 |
pp_node_args nd.node_inputs |
232 | 233 |
pp_node_args nd.node_outputs |
... | ... | |
248 | 249 |
(*fprintf fmt "@ /* Scheduling: %a */ @ " (fprintf_list ~sep:", " pp_print_string) (Scheduling.schedule_node nd)*) |
249 | 250 |
|
250 | 251 |
let pp_imported_node fmt ind = |
251 |
fprintf fmt "@[<v>node %s (%a) returns (%a) %t@]" |
|
252 |
fprintf fmt "@[<v>%s %s (%a) returns (%a) %t@]" |
|
253 |
(if ind.nodei_stateless then "function" else "node") |
|
252 | 254 |
ind.nodei_id |
253 | 255 |
pp_node_args ind.nodei_inputs |
254 | 256 |
pp_node_args ind.nodei_outputs |
255 | 257 |
(fun fmt -> if ind.nodei_stateless then Format.fprintf fmt "stateless") |
256 | 258 |
|
257 |
let pp_imported_fun fmt ind = |
|
258 |
fprintf fmt "@[<v>function %s (%a) returns (%a)@]" |
|
259 |
ind.fun_id |
|
260 |
pp_node_args ind.fun_inputs |
|
261 |
pp_node_args ind.fun_outputs |
|
262 |
|
|
263 | 259 |
let pp_decl fmt decl = |
264 | 260 |
match decl.top_decl_desc with |
265 | 261 |
| Node nd -> fprintf fmt "%a@ " pp_node nd |
266 | 262 |
| ImportedNode ind -> |
267 | 263 |
fprintf fmt "imported %a;@ " pp_imported_node ind |
268 |
| ImportedFun ind -> |
|
269 |
fprintf fmt "%a;@ " pp_imported_fun ind |
|
270 | 264 |
| Consts clist -> ( |
271 | 265 |
fprintf fmt "const %a@ " |
272 | 266 |
(fprintf_list ~sep:"@ " (fun fmt cdecl -> |
... | ... | |
282 | 276 |
match decl.top_decl_desc with |
283 | 277 |
| Node nd -> fprintf fmt "node %s@ " nd.node_id |
284 | 278 |
| ImportedNode ind -> fprintf fmt "imported node %s" ind.nodei_id |
285 |
| ImportedFun ind -> fprintf fmt "function %s" ind.fun_id |
|
286 | 279 |
| Consts clist -> ( |
287 | 280 |
fprintf fmt "const %a@ " |
288 | 281 |
(fprintf_list ~sep:"@ " (fun fmt cdecl -> |
... | ... | |
297 | 290 |
nd.node_id |
298 | 291 |
pp_node_args nd.node_inputs |
299 | 292 |
pp_node_args nd.node_outputs |
300 |
| ImportedNode _ | ImportedFun _ | Consts _ | Open _ -> ()
|
|
293 |
| ImportedNode _ | Consts _ | Open _ -> () |
|
301 | 294 |
|
302 | 295 |
|
303 | 296 |
|
Also available in: Unified diff