[PATCH] D121092: [pseudo] Strip comments for TokenStream.

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 7 04:55:19 PST 2022


sammccall accepted this revision.
sammccall added inline comments.
This revision is now accepted and ready to land.


================
Comment at: clang/include/clang/Tooling/Syntax/Pseudo/Preprocess.h:144
 
+/// Drops comment tokens.
+TokenStream stripComments(const TokenStream &);
----------------
I think this fits more naturally into Token.h next to cook().

It produces and consumes a token stream, and its implementation is a trivial use of those APIs.

While formally we might see comment stripping as part of the preprocessor, this file is more to do with directive structure. (Maybe it should be renamed?)


================
Comment at: clang/unittests/Tooling/Syntax/Pseudo/PreprocessTest.cpp:158
+  // comment
+  int;
+)cpp";
----------------
also include a `/*comment*/` between int and ;?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D121092



More information about the cfe-commits mailing list