[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)

2023-11-29 Thread Aaron Ballman via cfe-commits


@@ -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
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[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)

2023-11-29 Thread Owen Pan via cfe-commits


@@ -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);

owenca wrote:

+1.

https://github.com/llvm/llvm-project/pull/68620
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits