[clang-tools-extra] [flang] [clang] [compiler-rt] [libcxx] [llvm] [lldb] [libc] ✨ [Sema, Lex, Parse] Preprocessor embed in C and C++ (and Obj-C and Obj-C++ by-proxy) (PR #68620)

Aaron Ballman via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 29 11:50:41 PST 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);
----------------
AaronBallman wrote:

Thanks! When you get to the point of working on this, I'm happy to review/help how I can.

https://github.com/llvm/llvm-project/pull/68620


More information about the llvm-commits mailing list