[PATCH] D124749: [clang-format] Handle Verilog preprocessor directives

2022-06-25 Thread sstwcw via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG2e32ff106e74: [clang-format] Handle Verilog preprocessor directives (authored by sstwcw). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124749/new/ https://

[PATCH] D124749: [clang-format] Handle Verilog preprocessor directives

2022-06-13 Thread Björn Schäpers via Phabricator via cfe-commits
HazardyKnusperkeks accepted this revision. HazardyKnusperkeks added inline comments. This revision is now accepted and ready to land. Herald added a subscriber: nlopes. Comment at: clang/lib/Format/FormatToken.h:982 kw_always = &IdentTable.get("always"); kw_always_com

[PATCH] D124749: [clang-format] Handle Verilog preprocessor directives

2022-06-09 Thread sstwcw via Phabricator via cfe-commits
sstwcw marked 3 inline comments as done. sstwcw added inline comments. Comment at: clang/lib/Format/FormatToken.h:1142 +VerilogExtraKeywords = +std::unordered_set({kw_always, + kw_always_comb, Now that I ad

[PATCH] D124749: [clang-format] Handle Verilog preprocessor directives

2022-06-09 Thread sstwcw via Phabricator via cfe-commits
sstwcw updated this revision to Diff 435788. sstwcw added a comment. - add `kw_` prefix to symbols treated as keywords - use lambda instead of breaking Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124749/new/ https://reviews.llvm.org/D124749 File

[PATCH] D124749: [clang-format] Handle Verilog preprocessor directives

2022-06-03 Thread Björn Schäpers via Phabricator via cfe-commits
HazardyKnusperkeks added inline comments. Comment at: clang/lib/Format/FormatTokenLexer.cpp:1121 + const char *Start = Lex->getBufferLocation(); + if (!VerilogToken.match(StringRef(Start, Lex->getBuffer().end() - Start), + &Matches)) Ad

[PATCH] D124749: [clang-format] Handle Verilog preprocessor directives

2022-06-02 Thread sstwcw via Phabricator via cfe-commits
sstwcw updated this revision to Diff 433702. sstwcw added a comment. - add comment and format Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124749/new/ https://reviews.llvm.org/D124749 Files: clang/lib/Format/FormatToken.h clang/lib/Format/For

[PATCH] D124749: [clang-format] Handle Verilog preprocessor directives

2022-06-02 Thread sstwcw via Phabricator via cfe-commits
sstwcw marked 2 inline comments as done. sstwcw added inline comments. Comment at: clang/lib/Format/UnwrappedLineParser.cpp:1889 TokenCount = Line->Tokens.size(); - if (TokenCount == 1 || - (TokenCount == 2 && Line->Tokens.front().Tok->is(tok::comment))) { --

[PATCH] D124749: [clang-format] Handle Verilog preprocessor directives

2022-06-02 Thread Björn Schäpers via Phabricator via cfe-commits
HazardyKnusperkeks added inline comments. Comment at: clang/lib/Format/UnwrappedLineParser.cpp:1889 TokenCount = Line->Tokens.size(); - if (TokenCount == 1 || - (TokenCount == 2 && Line->Tokens.front().Tok->is(tok::comment))) { Why did you re

[PATCH] D124749: [clang-format] Handle Verilog preprocessor directives

2022-06-01 Thread sstwcw via Phabricator via cfe-commits
sstwcw updated this revision to Diff 433614. sstwcw added a comment. - use raw string for regex - use default style in test - remove parentheses - use seek now that skipOver no longer exists Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124749/new/

[PATCH] D124749: [clang-format] Handle Verilog preprocessor directives

2022-06-01 Thread sstwcw via Phabricator via cfe-commits
sstwcw marked 5 inline comments as done. sstwcw added inline comments. Comment at: clang/unittests/Format/FormatTestVerilog.cpp:179 + verifyFormat("`x = (`x1 + `x2 + x);"); + // Lines starting with a preprocessor directive should not be indented. + std::string Directives[] = {

[PATCH] D124749: [clang-format] Handle Verilog preprocessor directives

2022-05-16 Thread Björn Schäpers via Phabricator via cfe-commits
HazardyKnusperkeks added a comment. In D124749#3514224 , @sstwcw wrote: > The two parents of this revision change the same file, so the build bot says > patch does not apply. Does that mean I have to submit the parent patches > with less context? Mayb

[PATCH] D124749: [clang-format] Handle Verilog preprocessor directives

2022-05-15 Thread sstwcw via Phabricator via cfe-commits
sstwcw added a comment. The two parents of this revision change the same file, so the build bot says patch does not apply. Does that mean I have to submit the parent patches with less context? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124749/

[PATCH] D124749: [clang-format] Handle Verilog preprocessor directives

2022-05-15 Thread sstwcw via Phabricator via cfe-commits
sstwcw added inline comments. Comment at: clang/lib/Format/FormatTokenLexer.cpp:1105 + static const llvm::Regex VerilogToken( + "^(\'|``?|((\r?\n|\r)|[^[:space:]])*)"); + HazardyKnusperkeks wrote: > Consider a raw string, for a better reading. You m

[PATCH] D124749: [clang-format] Handle Verilog preprocessor directives

2022-05-15 Thread sstwcw via Phabricator via cfe-commits
sstwcw updated this revision to Diff 429532. sstwcw added a comment. - add tests and remove __LINE__ and __FILE__ special cases Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124749/new/ https://reviews.llvm.org/D124749 Files: clang/lib/Format/Fo

[PATCH] D124749: [clang-format] Handle Verilog preprocessor directives

2022-05-04 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay added a comment. You add significant number of keywords here but I don't see any of them being tested? can you add a unit tests to cover what you are adding Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124749/new/ https://reviews.l

[PATCH] D124749: [clang-format] Handle Verilog preprocessor directives

2022-05-01 Thread Björn Schäpers via Phabricator via cfe-commits
HazardyKnusperkeks added inline comments. Comment at: clang/lib/Format/FormatTokenLexer.cpp:1105 + static const llvm::Regex VerilogToken( + "^(\'|``?|((\r?\n|\r)|[^[:space:]])*)"); + Consider a raw string, for a better reading. Co

[PATCH] D124749: [clang-format] Handle Verilog preprocessor directives

2022-05-01 Thread sstwcw via Phabricator via cfe-commits
sstwcw added a comment. This revision depends on D124748 , but somehow it doesn't show up when I open the parent revision dialog. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124749/new/ https://reviews.llvm.org/

[PATCH] D124749: [clang-format] Handle Verilog preprocessor directives

2022-05-01 Thread sstwcw via Phabricator via cfe-commits
sstwcw created this revision. sstwcw added reviewers: HazardyKnusperkeks, MyDeveloperDay, curdeius, owenpan. Herald added a project: All. sstwcw requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Repository: rG LLVM Github Monorepo https://