[PATCH] D128411: [syntax] Introduce a BaseToken class.

Ilya Biryukov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 24 06:10:57 PDT 2022


ilya-biryukov added inline comments.


================
Comment at: clang/include/clang/Tooling/Syntax/TokenManager.h:23
+
+/// Base token interfaces for the syntax-tree.
+class TokenManager {
----------------
NIT: maybe explain the `TokenManager` concept here, the comment seems to be a leftover from the previous revision.


================
Comment at: clang/lib/Tooling/Syntax/Tree.cpp:271
+      // FIXME: can be fixed by adding an tok::Kind in the Leaf node.
+      // assert(cast<Leaf>(C).getToken()->kind() == L->getDelimiterTokenKind());
     }
----------------
Maybe add `TokenManager::getKind(Key)` right away and remove this FIXME.
This should as simple as `cast<syntax::Token>(T)->Kind`, right? Or am I missing some complications?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D128411



More information about the cfe-commits mailing list