[PATCH] D116190: Comment parsing: Don't recognize commands in single-line double quotation

Aaron Puchert via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 14 05:10:03 PST 2022


aaronpuchert marked an inline comment as done.
aaronpuchert added inline comments.


================
Comment at: clang/lib/AST/CommentLexer.cpp:278
+
+again:
+  size_t End =
----------------
gribozavr2 wrote:
> I'd suggest refactoring to a `while (true)` if you don't mind.
I was imitating `lexVerbatimBlockFirstLine`, but I don't mind either way.


================
Comment at: clang/lib/AST/CommentLexer.cpp:290
+    if (End != StringRef::npos && *(TokenPtr + End) == '\"')
+      TokenPtr += End + 1;
+    goto again;
----------------
gribozavr2 wrote:
> Does Doxygen understand escaped quotes?
> 
> ```
> /// "@hello\"@hello"
> ```
Vim syntax highlighting suggests it does, but at least my version actually doesn't: `"@c a \" @c b"` is translated to `"@c a \" <code>b"</code>`. So the escaped quote seems to end the quotation.


================
Comment at: clang/lib/AST/CommentLexer.cpp:485
 void Lexer::lexVerbatimBlockFirstLine(Token &T) {
 again:
   assert(BufferPtr < CommentEnd);
----------------
This is what I was imitating.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D116190



More information about the cfe-commits mailing list