Page MenuHomePhabricator

[clang-format] Handle Verilog numbers and operators
ClosedPublic

Authored by sstwcw on Jun 1 2022, 6:48 PM.

Diff Detail

Event Timeline

sstwcw created this revision.Jun 1 2022, 6:48 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 1 2022, 6:48 PM
sstwcw requested review of this revision.Jun 1 2022, 6:48 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 1 2022, 6:48 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
HazardyKnusperkeks added a project: Restricted Project.Jun 2 2022, 3:16 AM
clang/lib/Format/FormatToken.h
138

One should move the CSharp stuff, since all other languages are sorted correctly. So I'd say please move above the CSharp.

1523

apostrophe

clang/lib/Format/FormatTokenLexer.cpp
247

I think here are braces needed.

clang/unittests/Format/FormatTestVerilog.cpp
163

You should add token annotator tests to see if the tokens are parsed as you want to. Formatting mostly follows.

owenpan added inline comments.Jun 2 2022, 9:55 PM
clang/lib/Format/FormatToken.h
138–139

Can you move the comment to above the code?

clang/lib/Format/FormatTokenLexer.cpp
247

+1. And other places where the conditional and/or the body can't fit on a single line.

1121
1123
1172
clang/lib/Format/FormatTokenLexer.h
63

Merge the most recently lexed tokens?

MyDeveloperDay added inline comments.Jun 6 2022, 2:02 AM
clang/lib/Format/FormatToken.h
1518–1519

maybe kw_verilogHash and kw_verilogHashHash and kw_quote for clarity when using isOneOf

1523

kw_apostrophe?

sstwcw updated this revision to Diff 439981.Jun 25 2022, 6:06 AM
  • address comments
  • add token annotator tests
sstwcw marked 12 inline comments as done.Jun 25 2022, 6:31 AM

Are there any problems with this revision? The ones that depend on it are approved.

This revision is now accepted and ready to land.Jul 26 2022, 1:28 PM

Are there any problems with this revision? The ones that depend on it are approved.

Sorry, last time you updated I had no time, and then I forgot.

This revision was landed with ongoing or failed builds.Jul 28 2022, 5:39 PM
This revision was automatically updated to reflect the committed changes.