This is an archive of the discontinued LLVM Phabricator instance.

[clang-format] Fix non-case colons in Verilog case lines
ClosedPublic

Authored by sstwcw on Mar 12 2023, 3:40 PM.

Details

Summary

Back in D128714, we should have replaced the old rule about colons when
we added the new one. Because we didn't, all colons got mistaken as
case colons as long as the line began with case or default.

Diff Detail

Event Timeline

sstwcw created this revision.Mar 12 2023, 3:40 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 12 2023, 3:40 PM
sstwcw requested review of this revision.Mar 12 2023, 3:40 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 12 2023, 3:40 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
sstwcw added a project: Restricted Project.Mar 12 2023, 3:40 PM
clang/lib/Format/TokenAnnotator.cpp
4430

Hmm.. this is going to impact others, did you make a change here before and break something for c++? or was this a bug in the C++ code, is there not a unit test for setting SpaceBeforeCaseColon?

sstwcw marked an inline comment as done.Mar 15 2023, 6:11 PM
sstwcw added inline comments.
clang/lib/Format/TokenAnnotator.cpp
4430

You can see that the previous rule already covers what this one covers. This rule doesn't change the behavior for C++.

sstwcw marked an inline comment as done.Mar 15 2023, 6:11 PM
MyDeveloperDay accepted this revision.Mar 16 2023, 2:15 PM
This revision is now accepted and ready to land.Mar 16 2023, 2:15 PM
rymiel accepted this revision.Mar 17 2023, 2:30 AM
This revision was landed with ongoing or failed builds.Mar 19 2023, 2:41 PM
This revision was automatically updated to reflect the committed changes.