Project

General

Profile

Revision 990ae4ee src/backends/VHDL/mini_vhdl_ast_pp.ml

View differences:

src/backends/VHDL/mini_vhdl_ast_pp.ml
298 298
  ((let open! Ppx_deriving_runtime in
299 299
      fun fmt  ->
300 300
        fun x  ->
301
          Format.fprintf fmt "@[<2>{ ";
302
          ((Format.fprintf fmt "@[%s =@ " "if_cond";
303
            ((__0 ()) fmt) x.if_cond;
304
            Format.fprintf fmt "@]");
305
           Format.fprintf fmt ";@ ";
306
           Format.fprintf fmt "@[%s =@ " "if_block";
307
           ((fun x  ->
308
               Format.fprintf fmt "@[<2>[";
309
               ignore
310
                 (List.fold_left
311
                    (fun sep  ->
312
                       fun x  ->
313
                         if sep then Format.fprintf fmt ";@ ";
314
                         ((__1 ()) fmt) x;
315
                         true) false x);
316
               Format.fprintf fmt "@,]@]")) x.if_block;
317
           Format.fprintf fmt "@]");
318
          Format.fprintf fmt "@ }@]")
301
          Format.fprintf fmt " (";
302
          ((__0 ()) fmt) x.if_cond;
303
          Format.fprintf fmt ") then@;<0 2>";
304
          ((fun x  ->
305
             ignore
306
               (List.fold_left
307
                  (fun sep  ->
308
                     fun x  ->
309
                             if sep then Format.fprintf fmt "@;<0 2>";
310
                       ((__1 ()) fmt) x;
311
                       Format.fprintf fmt ";";
312
                       true) false x);
313
          )) x.if_block;)
319 314
    [@ocaml.warning "-A"])
320 315

  
321 316
and show_mini_vhdl_if_case_t :
......
331 326
  ((let open! Ppx_deriving_runtime in
332 327
      fun fmt  ->
333 328
        fun x  ->
334
          Format.fprintf fmt "@[<2>{ ";
335
          ((Format.fprintf fmt "@[%s =@ " "when_cond";
329
                Format.fprintf fmt "@;@[<v 2>when ";
336 330
            ((fun x  ->
337
                Format.fprintf fmt "@[<2>[";
338 331
                ignore
339 332
                  (List.fold_left
340 333
                     (fun sep  ->
341 334
                        fun x  ->
342
                          if sep then Format.fprintf fmt ";@ ";
335
                          if sep then Format.fprintf fmt "@ |@ ";
343 336
                          ((__0 ()) fmt) x;
344
                          true) false x);
345
                Format.fprintf fmt "@,]@]")) x.when_cond;
346
            Format.fprintf fmt "@]");
347
           Format.fprintf fmt ";@ ";
348
           Format.fprintf fmt "@[%s =@ " "when_stmt";
349
           ((fun x  ->
350
               Format.fprintf fmt "@[<2>[";
337
                          true) false x);)) x.when_cond;
338
           Format.fprintf fmt " => ";
339
           (fun x  ->
351 340
               ignore
352 341
                 (List.fold_left
353 342
                    (fun sep  ->
354 343
                       fun x  ->
355
                         if sep then Format.fprintf fmt ";@ ";
344
                         if sep then Format.fprintf fmt "@;";
356 345
                         ((__1 ()) fmt) x;
357
                         true) false x);
358
               Format.fprintf fmt "@,]@]")) x.when_stmt;
359
           Format.fprintf fmt "@]");
360
          Format.fprintf fmt "@ }@]")
346
                         Format.fprintf fmt ";";
347
                         true) ((List.length x) > 1) x);) x.when_stmt;
348
           Format.fprintf fmt "@]")
361 349
    [@ocaml.warning "-A"])
362 350

  
363 351
and show_mini_vhdl_case_item_t :
......
510 498
                            ((__14 ()) fmt) x;
511 499
                            Format.fprintf fmt ";";
512 500
                            true) false x))) astmts;
513
              Format.fprintf fmt "@]@;end";)    [@ocaml.warning "-A"])
501
              Format.fprintf fmt "@]@;end";)
502
    [@ocaml.warning "-A"])
514 503

  
515 504
and show_mini_vhdl_declaration_t :
516 505
  mini_vhdl_declaration_t -> Ppx_deriving_runtime.string =
......
529 518
  ((let open! Ppx_deriving_runtime in
530 519
      fun fmt  ->
531 520
        fun x  ->
532
          Format.fprintf fmt "@[<2>{ ";
533
          (((Format.fprintf fmt "@[%s =@ " "use_clause";
534
             ((function
535
               | None  -> Format.pp_print_string fmt "None"
536
               | Some x ->
537
                   (Format.pp_print_string fmt "(Some ";
538
                    ((__0 ()) fmt) x;
539
                    Format.pp_print_string fmt ")"))) x.use_clause;
540
             Format.fprintf fmt "@]");
541
            Format.fprintf fmt ";@ ";
542
            Format.fprintf fmt "@[%s =@ " "declaration";
543
            ((function
544
              | None  -> Format.pp_print_string fmt "None"
545
              | Some x ->
546
                  (Format.pp_print_string fmt "(Some ";
547
                   ((__1 ()) fmt) x;
548
                   Format.pp_print_string fmt ")"))) x.declaration;
549
            Format.fprintf fmt "@]");
550
           Format.fprintf fmt ";@ ";
551
           Format.fprintf fmt "@[%s =@ " "definition";
552
           ((function
553
             | None  -> Format.pp_print_string fmt "None"
554
             | Some x ->
555
                 (Format.pp_print_string fmt "(Some ";
556
                  ((__2 ()) fmt) x;
557
                  Format.pp_print_string fmt ")"))) x.definition;
558
           Format.fprintf fmt "@]");
559
          Format.fprintf fmt "@ }@]")
521
          (match x.use_clause with
522
          | None -> Format.fprintf fmt "";
523
          | Some e -> ((__0 ()) fmt) e);
524
          (match x.declaration with
525
          | None -> Format.fprintf fmt "";
526
          | Some e -> ((__1 ()) fmt) e);
527
          (match x.definition with
528
          | None -> Format.fprintf fmt "";
529
          | Some e -> ((__2 ()) fmt) e);)
560 530
    [@ocaml.warning "-A"])
561 531

  
562 532
and show_mini_vhdl_declarative_item_t :

Also available in: Unified diff