Project

General

Profile

« Previous | Next » 

Revision 02440160

Added by Arnaud Dieumegard about 5 years ago

vhdl and mini_vhdl pp: remove empty lines and useless linebreaks in maps

View differences:

src/backends/VHDL/mini_vhdl_ast_pp.ml
559 559
          (match x.generic_map with
560 560
          | [] -> Format.fprintf fmt "";
561 561
          | _ ->
562
            (Format.fprintf fmt " generic map (@[<v 2>";
562
            (Format.fprintf fmt " generic map (@[";
563 563
            ((fun x  ->
564 564
            ignore
565 565
            (List.fold_left
566 566
               (fun sep  ->
567 567
                 fun x  ->
568
                   if sep then Format.fprintf fmt ",@,";
568
                   if sep then Format.fprintf fmt ",@ ";
569 569
                   ((__3 ()) fmt) x;
570 570
                   true) false x))) x.generic_map;
571
            Format.fprintf fmt ")@]@;"));
571
            Format.fprintf fmt "@])@;"));
572 572
          (match x.port_map with
573 573
          | [] -> Format.fprintf fmt ";";
574 574
          | _ ->
575
            (Format.fprintf fmt " port map (@[<v 2>";
575
            (Format.fprintf fmt " port map (@[";
576 576
            ((fun x  ->
577 577
            ignore
578 578
            (List.fold_left
579 579
               (fun sep  ->
580 580
                 fun x  ->
581
                   if sep then Format.fprintf fmt ",@,";
581
                   if sep then Format.fprintf fmt ",@ ";
582 582
                   ((__4 ()) fmt) x;
583 583
                   true) false x))) x.port_map;
584
            Format.fprintf fmt ")@];"));
584
            Format.fprintf fmt "@]);"));
585 585
          Format.fprintf fmt "@]")
586 586
    [@ocaml.warning "-A"])
587 587

  
......
645 645
                         ((__3 ()) fmt) x;
646 646
                         Format.fprintf fmt ";";
647 647
                         true) false x);)) x.body;
648
          Format.fprintf fmt "@]@;end process;@;")
648
          Format.fprintf fmt "@]@;end process;")
649 649
    [@ocaml.warning "-A"])
650 650

  
651 651
and show_mini_vhdl_process_t :
src/backends/VHDL/vhdl_ast_pp.ml
1549 1549
                         ((__3 ()) fmt) x;
1550 1550
                         Format.fprintf fmt ";";
1551 1551
                         true) false x);)) x.body;
1552
          Format.fprintf fmt "@]@;end process;@;")
1552
          Format.fprintf fmt "@]@;end process;")
1553 1553
    [@ocaml.warning "-A"])
1554 1554

  
1555 1555
and show_vhdl_process_t : vhdl_process_t -> Ppx_deriving_runtime.string =
......
1631 1631
          (match x.generic_map with
1632 1632
          | [] -> Format.fprintf fmt "";
1633 1633
          | _ ->
1634
            (Format.fprintf fmt " generic map (@[<v 2>";
1634
            (Format.fprintf fmt " generic map (@[";
1635 1635
            ((fun x  ->
1636 1636
            ignore
1637 1637
            (List.fold_left
1638 1638
               (fun sep  ->
1639 1639
                 fun x  ->
1640
                   if sep then Format.fprintf fmt ",@,";
1640
                   if sep then Format.fprintf fmt ",@ ";
1641 1641
                   ((__3 ()) fmt) x;
1642 1642
                   true) false x))) x.generic_map;
1643 1643
            Format.fprintf fmt ")@]@;"));
1644 1644
          (match x.port_map with
1645 1645
          | [] -> Format.fprintf fmt ";";
1646 1646
          | _ ->
1647
            (Format.fprintf fmt " port map (@[<v 2>";
1647
            (Format.fprintf fmt " port map (@[";
1648 1648
            ((fun x  ->
1649 1649
            ignore
1650 1650
            (List.fold_left
1651 1651
               (fun sep  ->
1652 1652
                 fun x  ->
1653
                   if sep then Format.fprintf fmt ",@,";
1653
                   if sep then Format.fprintf fmt ",@ ";
1654 1654
                   ((__4 ()) fmt) x;
1655 1655
                   true) false x))) x.port_map;
1656 1656
            Format.fprintf fmt ")@];"));
......
1709 1709
          (match x.generics with
1710 1710
          | [] -> Format.fprintf fmt "";
1711 1711
          | _ -> 
1712
              Format.fprintf fmt "generic (@[<v>";
1712
              Format.fprintf fmt "generic (@[";
1713 1713
              ((fun x  ->
1714 1714
                ignore
1715 1715
                (List.fold_left
1716 1716
                  (fun sep  ->
1717 1717
                    fun x  ->
1718
                      if sep then Format.fprintf fmt ";@;";
1718
                      if sep then Format.fprintf fmt ";@ ";
1719 1719
                        ((__1 ()) fmt) x;
1720 1720
                        true) false x))) x.generics;
1721 1721
              Format.fprintf fmt "@]);");
1722 1722
          (match x.ports with
1723 1723
          | [] -> Format.fprintf fmt "";
1724 1724
          | _ -> 
1725
              Format.fprintf fmt "port (@[<v>";
1725
              Format.fprintf fmt "port (@[";
1726 1726
              ((fun x  ->
1727 1727
                 ignore
1728 1728
                   (List.fold_left
1729 1729
                      (fun sep  ->
1730 1730
                         fun x  ->
1731
                           if sep then Format.fprintf fmt ";@;";
1731
                           if sep then Format.fprintf fmt ";@ ";
1732 1732
                           ((__2 ()) fmt) x;
1733 1733
                           true) false x))) x.ports;
1734 1734
              Format.fprintf fmt "@]);");
......
1839 1839
                       ((__2 ()) fmt) x;
1840 1840
                       Format.fprintf fmt ";";
1841 1841
                       true) false x))) x.declarations;
1842
          Format.fprintf fmt "@;";
1842
          Format.fprintf fmt "@.";
1843 1843
          Format.fprintf fmt "@[<v 2>begin@;";
1844 1844
          (match x.body with
1845 1845
            | [] -> Format.fprintf fmt "";
......
1852 1852
                         if sep then Format.fprintf fmt "@;";
1853 1853
                         ((__3 ()) fmt) x;
1854 1854
                         true) false x))) x.body);
1855
          Format.fprintf fmt "@]@;")
1855
          Format.fprintf fmt "@]")
1856 1856
    [@ocaml.warning "-A"])
1857 1857

  
1858 1858
and show_vhdl_architecture_t :
......
1897 1897
        | Architecture a0 ->
1898 1898
            (Format.fprintf fmt "@[<v 2>architecture ";
1899 1899
             ((__2 ()) fmt) a0;
1900
             Format.fprintf fmt "@.end;@]")
1900
             Format.fprintf fmt "@.end;")
1901 1901
        | Configuration a0 ->
1902 1902
            (Format.fprintf fmt "@[<v 2>configuration ";
1903 1903
             ((__3 ()) fmt) a0;

Also available in: Unified diff