HazardyKnusperkeks added inline comments.

================
Comment at: clang/lib/Format/FormatToken.h:992-999
+  enum {
+    ATTR_JS_KEYWORD = 0x1,
+    ATTR_CSHARP_KEYWORD = 0x2,
+  };
+  unsigned getAttrs(const FormatToken &Tok) const {
+    auto At = KeywordAttr.find(Tok.Tok.getIdentifierInfo());
+    return At == KeywordAttr.end() ? 0u : At->second;
----------------
sstwcw wrote:
> HazardyKnusperkeks wrote:
> > No fan of DEFINE_LIKE_NAMES. More a fan of scoped::enums. ;)
> It looks like I would have to use the `KeywordLanguage::` prefix throughout 
> the macro list and also define an operator to combine categories for keywords 
> that several languages have.  Do you know of a simpler way?  With the current 
> enum, the DEFINE_LIKE_NAMES can't be used directly outside 
> `AdditionalKeywords`.
You can always drop the `class` and are back at integers.


================
Comment at: clang/lib/Format/FormatToken.h:992-999
+  enum {
+    ATTR_JS_KEYWORD = 0x1,
+    ATTR_CSHARP_KEYWORD = 0x2,
+  };
+  unsigned getAttrs(const FormatToken &Tok) const {
+    auto At = KeywordAttr.find(Tok.Tok.getIdentifierInfo());
+    return At == KeywordAttr.end() ? 0u : At->second;
----------------
HazardyKnusperkeks wrote:
> sstwcw wrote:
> > HazardyKnusperkeks wrote:
> > > No fan of DEFINE_LIKE_NAMES. More a fan of scoped::enums. ;)
> > It looks like I would have to use the `KeywordLanguage::` prefix throughout 
> > the macro list and also define an operator to combine categories for 
> > keywords that several languages have.  Do you know of a simpler way?  With 
> > the current enum, the DEFINE_LIKE_NAMES can't be used directly outside 
> > `AdditionalKeywords`.
> You can always drop the `class` and are back at integers.
> With the current enum, the DEFINE_LIKE_NAMES can't be used directly outside 
> `AdditionalKeywords`.

This one I don't understand? They are public and can be used, can't they? And 
the type I can get with `decltype`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D121753/new/

https://reviews.llvm.org/D121753

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to