[clang] [Sema, Lex, Parse] Preprocessor embed in C and C++ (and Obj-C and Obj-C++ by-proxy) (PR #68620)
Björn Schäpers via cfe-commits
cfe-commits at lists.llvm.org
Mon Oct 9 12:36:24 PDT 2023
================
@@ -1464,6 +1467,21 @@ class AnnotatingParser {
}
}
+ void parseEmbedDirective() {
+ if (CurrentToken && CurrentToken->is(tok::less)) {
+ next();
+ while (CurrentToken) {
+ // Mark tokens up to the trailing line comments as implicit string
+ // literals.
+ if (CurrentToken->isNot(tok::comment) &&
+ !CurrentToken->TokenText.startswith("//")) {
+ CurrentToken->setType(TT_ImplicitStringLiteral);
----------------
HazardyKnusperkeks wrote:
Can you please add tests in `TokenAnnotatorTest.cpp`?
https://github.com/llvm/llvm-project/pull/68620
More information about the cfe-commits
mailing list