Add a utility function to strip comments from a "raw" tokenstream. The
derived stream will be fed to the GLR parser (for early testing).
Details
- Reviewers
sammccall - Commits
- rG2d01ac18df93: [pseudo] Strip comments for TokenStream.
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang/include/clang/Tooling/Syntax/Pseudo/Preprocess.h | ||
---|---|---|
144 ↗ | (On Diff #413382) | 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?) |
clang/unittests/Tooling/Syntax/Pseudo/PreprocessTest.cpp | ||
158 ↗ | (On Diff #413382) | also include a /*comment*/ between int and ;? |
clang/include/clang/Tooling/Syntax/Pseudo/Preprocess.h | ||
---|---|---|
144 ↗ | (On Diff #413382) | moving to Token.h sounds good to me -- I'd treat this is a trivial implementation (I just wrote it to test the GLR parser). And yeah, stripping comment is just part of preprocessing the code.
The current Preprocess.h file name indicates that everything about preprocessing of TokenStream should live in it. Since this file defines PPStructure, just call it PPStructure.h/cpp for better fine grained granularity? |