[clang] [Clang][Comments] Add argument parsing for @throw @throws @exception (PR #84726)

via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 11 16:16:14 PDT 2024


================
@@ -149,6 +191,76 @@ class TextTokenRetokenizer {
     addToken();
   }
 
+  /// Extract a type argument
+  bool lexDataType(Token &Tok) {
+    if (isEnd())
+      return false;
+    Position SavedPos = Pos;
+    consumeWhitespace();
+    SmallString<32> NextToken;
+    SmallString<32> WordText;
+    const char *WordBegin = Pos.BufferPtr;
+    SourceLocation Loc = getSourceLocation();
+    StringRef ConstVal = StringRef("const");
----------------
hdoc wrote:

Yes, it should. We'll update the PR to support that. Thank you for noticing and mentioning this.

Likewise in the future we'll probably want to add support for `restrict`. It's not necessary for this PR since `throw/throws/exception` is only useful in C++ but when parsing Doxygen comments in C codebases we'll want to have the option of supporting that.

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


More information about the cfe-commits mailing list