[clang-format] Put ports on separate lines in Verilog module headers
authorsstwcw <f0gukp2nk@protonmail.com>
Mon, 20 Feb 2023 03:03:33 +0000 (03:03 +0000)
committersstwcw <f0gukp2nk@protonmail.com>
Mon, 20 Feb 2023 03:24:13 +0000 (03:24 +0000)
commit6e473aeffdc1c26307e19f68252767a32e0047ad
treee768b0e6c4e889953a5e6bebe498c80134b2153d
parent55900a0d207670cb7295b98b31bb9ed50613cd42
[clang-format] Put ports on separate lines in Verilog module headers

New:
```
module mh1
    (input var int in1,
     input var in2, in3,
     output tagged_st out);
endmodule
```

Old:
```
module mh1
    (input var int in1, input var in2, in3, output tagged_st out);
endmodule
```

`getNextNonComment` was modified to return a non-const pointer because
we needed to use it that way in `verilogGroupDecl`.

The comment on line 2626 was a typo.  We corrected it while modifying
the function.

Reviewed By: MyDeveloperDay

Differential Revision: https://reviews.llvm.org/D143825
clang/lib/Format/FormatToken.h
clang/lib/Format/TokenAnnotator.cpp
clang/unittests/Format/FormatTestVerilog.cpp