[all-commits] [llvm/llvm-project] 825cec: [clang-format] Add Verilog suffixes to the scripts
sstwcw via All-commits
all-commits at lists.llvm.org
Wed Aug 23 20:24:20 PDT 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 825cec2c0b1ecec49995126674a8e58cd813476c
https://github.com/llvm/llvm-project/commit/825cec2c0b1ecec49995126674a8e58cd813476c
Author: sstwcw <su3e8a96kzlver at posteo.net>
Date: 2023-08-24 (Thu, 24 Aug 2023)
Changed paths:
M clang/tools/clang-format/clang-format-diff.py
M clang/tools/clang-format/git-clang-format
Log Message:
-----------
[clang-format] Add Verilog suffixes to the scripts
I decided not to wait for D149088 because it was taking a long time.
The capture group in the regexp was changed to non-capturing. It
doesn't need to be captured.
Reviewed By: HazardyKnusperkeks, owenpan
Differential Revision: https://reviews.llvm.org/D154467
Commit: 16ccba51072bbc5ff4c66f91f939163dc91e5d96
https://github.com/llvm/llvm-project/commit/16ccba51072bbc5ff4c66f91f939163dc91e5d96
Author: sstwcw <su3e8a96kzlver at posteo.net>
Date: 2023-08-24 (Thu, 24 Aug 2023)
Changed paths:
M clang/docs/ClangFormatStyleOptions.rst
M clang/include/clang/Format/Format.h
M clang/lib/Format/BreakableToken.cpp
M clang/lib/Format/BreakableToken.h
M clang/lib/Format/ContinuationIndenter.cpp
M clang/lib/Format/FormatToken.h
M clang/lib/Format/TokenAnnotator.cpp
M clang/lib/Format/WhitespaceManager.cpp
M clang/unittests/Format/FormatTestCSharp.cpp
M clang/unittests/Format/FormatTestJS.cpp
M clang/unittests/Format/FormatTestJava.cpp
M clang/unittests/Format/FormatTestVerilog.cpp
M clang/unittests/Format/TokenAnnotatorTest.cpp
Log Message:
-----------
[clang-format] Break long string literals in C#, etc.
Now strings that are too long for one line in C#, Java, JavaScript, and
Verilog get broken into several lines. C# and JavaScript interpolated
strings are not broken.
A new subclass BreakableStringLiteralUsingOperators is used to handle
the logic for adding plus signs and commas. The updateAfterBroken
method was added because now parentheses or braces may be required after
the parentheses or commas are added. In order to decide whether the
added plus sign should be unindented in the BreakableToken object, the
logic for it is taken out into a separate function
shouldUnindentNextOperator.
The logic for finding the continuation indentation when the option
AlignAfterOpenBracket is set to DontAlign is not implemented yet. So in
that case the new line may have the wrong indentation, and the parts may
have the wrong length if the string needs to be broken more than once
because finding where to break the string depends on where the string
starts.
The preambles for the C# and Java unit tests are changed to the newer
style in order to allow the 3-argument verifyFormat macro. Some cases
are changed from verifyFormat to verifyImcompleteFormat because those
use incomplete code and the new verifyFormat function checks that the
code is complete.
The line in the doc was changed to being indented by 4 spaces, that is,
the default continuation indentation. It has always been the case. It
was probably a mistake that the doc showed 2 spaces previously.
Reviewed By: MyDeveloperDay
Differential Revision: https://reviews.llvm.org/D154093
Compare: https://github.com/llvm/llvm-project/compare/b65ce4ea7c1f...16ccba51072b
More information about the All-commits
mailing list