HazardyKnusperkeks added inline comments.
================ Comment at: clang/lib/Format/FormatToken.h:374 + /// Verilog we want to treat the backtick like a hash. + tok::TokenKind AliasToken = tok::unknown; + ---------------- sstwcw wrote: > HazardyKnusperkeks wrote: > > Can't we do that with a type? > > > > I'm not very happy about the alias, because you can still call > > `Tok.getKind()`. > The main problem I seek to solve with the alias thing is with `tok::hash`. > In Verilog they use a backtick instead of a hash. At first I modified all > places in the code to recognize the backtick. MyDeveloperDay said "year > really not nice.. its like we can never use tok::hash again!" Using a type > also requires modifying all instances of tok::hash if I get you right. How > do I please everyone? Then you must hide Tok in the private part, so that no one can ever access `Tok.getKind()` accidentally. ================ Comment at: clang/lib/Format/FormatToken.h:1533 + switch (Tok.Tok.getKind()) { + case tok::kw_case: + case tok::kw_class: ---------------- sstwcw wrote: > HazardyKnusperkeks wrote: > > So you have a blacklist what is not a keyword? Seems a bit non future > > proof, new C++ keywords would have to be added here. > This is a whitelist of what is a keyword. My bad. Go on. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D123450/new/ https://reviews.llvm.org/D123450 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits