[PATCH] D85295: [SyntaxTree] Implement the List construct.
Eduardo Caldas via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Aug 10 03:01:19 PDT 2020
eduucaldas added inline comments.
================
Comment at: clang/include/clang/Tooling/Syntax/Tree.h:249
+
+ /// Return whether *under valid code* the list can be empty.
+ ///
----------------
gribozavr2 wrote:
> "Whether this list can be empty in syntactically and semantically correct code.
>
> This list may be empty when the source code has errors even if canBeEmpty() returns true."
"...even if `canBeEmpty()` returns **false**"
================
Comment at: clang/lib/Tooling/Syntax/Tree.cpp:367
+clang::tok::TokenKind syntax::List::getDelimiterTokenKind() {
+ llvm_unreachable("A list can have only elements and delimiters as children.");
+}
----------------
gribozavr2 wrote:
> I think a better error message would say that there are no subclasses of List, so this method can't be called.
Very sorry about that, this error was a copy-paste, I forgot to edit it
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D85295/new/
https://reviews.llvm.org/D85295
More information about the cfe-commits
mailing list