sammccall accepted this revision.
sammccall added inline comments.
This revision is now accepted and ready to land.


================
Comment at: clang-tools-extra/pseudo/lib/cxx/CXX.cpp:164
 
+bool isStructuredBinding(const ForestNode* N) {
+  assert(N->symbol() == Symbol::decl_specifier_seq);
----------------
nit: specifiesStructuredBinding?
(because the structured binding itself is something bigger)


================
Comment at: clang-tools-extra/pseudo/lib/cxx/CXX.cpp:166
+  assert(N->symbol() == Symbol::decl_specifier_seq);
+  for (const auto &Child : N->descendants()) {
+    if (Child.kind() == ForestNode::Terminal) {
----------------
If you're going to iterate over tokens, it seems more direct (and cheaper) to 
do it directly:
`for (const Tok& : P.Tokens.tokens(RHS[0].startTokenIndex(), 
RHS[1].startTokenIndex()))`


================
Comment at: clang-tools-extra/pseudo/test/cxx/structured-binding.cpp:1
+
+// RUN: clang-pseudo -grammar=cxx -source=%s --start-symbol=statement-seq 
--print-forest | FileCheck %s
----------------
nit: drop blank line


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D132260

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to