hokein updated this revision to Diff 434733. hokein added a comment. pull out a separate test file.
Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D125479/new/ https://reviews.llvm.org/D125479 Files: clang-tools-extra/pseudo/lib/cxx.bnf clang-tools-extra/pseudo/test/cxx/parameter-decl-clause.cpp clang-tools-extra/pseudo/test/cxx/unsized-array.cpp Index: clang-tools-extra/pseudo/test/cxx/unsized-array.cpp =================================================================== --- clang-tools-extra/pseudo/test/cxx/unsized-array.cpp +++ clang-tools-extra/pseudo/test/cxx/unsized-array.cpp @@ -1,6 +1,6 @@ // RUN: clang-pseudo -grammar=%cxx-bnf-file -source=%s --print-forest | FileCheck %s void s(int[]); -// CHECK: parameter-declaration-list~parameter-declaration := decl-specifier-seq abstract-declarator +// CHECK: parameter-declaration-clause~parameter-declaration := decl-specifier-seq abstract-declarator // CHECK-NEXT: ├─decl-specifier-seq~INT := tok[3] // CHECK-NEXT: └─abstract-declarator~noptr-abstract-declarator := [ ] // CHECK-NEXT: ├─[ := tok[4] Index: clang-tools-extra/pseudo/test/cxx/parameter-decl-clause.cpp =================================================================== --- /dev/null +++ clang-tools-extra/pseudo/test/cxx/parameter-decl-clause.cpp @@ -0,0 +1,14 @@ +// RUN: clang-pseudo -grammar=%cxx-bnf-file -source=%s --print-forest | FileCheck %s +void foo2(int, ...); +// CHECK: translation-unit~simple-declaration := decl-specifier-seq init-declarator-list ; +// CHECK-NEXT: ├─decl-specifier-seq~VOID := +// CHECK-NEXT: ├─init-declarator-list~noptr-declarator := noptr-declarator parameters-and-qualifiers +// CHECK-NEXT: │ ├─noptr-declarator~IDENTIFIER := +// CHECK-NEXT: │ └─parameters-and-qualifiers := ( parameter-declaration-clause ) +// CHECK-NEXT: │ ├─( := +// CHECK-NEXT: │ ├─parameter-declaration-clause := parameter-declaration-list , ... +// CHECK-NEXT: │ │ ├─parameter-declaration-list~INT := +// CHECK-NEXT: │ │ ├─, := +// CHECK-NEXT: │ │ └─... := +// CHECK-NEXT: │ └─) := +// CHECK-NEXT: └─; := Index: clang-tools-extra/pseudo/lib/cxx.bnf =================================================================== --- clang-tools-extra/pseudo/lib/cxx.bnf +++ clang-tools-extra/pseudo/lib/cxx.bnf @@ -409,7 +409,7 @@ noptr-declarator := noptr-declarator parameters-and-qualifiers noptr-declarator := noptr-declarator [ constant-expression_opt ] noptr-declarator := ( ptr-declarator ) -parameters-and-qualifiers := ( parameter-declaration-list_opt ) cv-qualifier-seq_opt ref-qualifier_opt noexcept-specifier_opt +parameters-and-qualifiers := ( parameter-declaration-clause_opt ) cv-qualifier-seq_opt ref-qualifier_opt noexcept-specifier_opt trailing-return-type := -> type-id ptr-operator := * cv-qualifier-seq_opt ptr-operator := &
Index: clang-tools-extra/pseudo/test/cxx/unsized-array.cpp =================================================================== --- clang-tools-extra/pseudo/test/cxx/unsized-array.cpp +++ clang-tools-extra/pseudo/test/cxx/unsized-array.cpp @@ -1,6 +1,6 @@ // RUN: clang-pseudo -grammar=%cxx-bnf-file -source=%s --print-forest | FileCheck %s void s(int[]); -// CHECK: parameter-declaration-list~parameter-declaration := decl-specifier-seq abstract-declarator +// CHECK: parameter-declaration-clause~parameter-declaration := decl-specifier-seq abstract-declarator // CHECK-NEXT: ââdecl-specifier-seq~INT := tok[3] // CHECK-NEXT: ââabstract-declarator~noptr-abstract-declarator := [ ] // CHECK-NEXT: ââ[ := tok[4] Index: clang-tools-extra/pseudo/test/cxx/parameter-decl-clause.cpp =================================================================== --- /dev/null +++ clang-tools-extra/pseudo/test/cxx/parameter-decl-clause.cpp @@ -0,0 +1,14 @@ +// RUN: clang-pseudo -grammar=%cxx-bnf-file -source=%s --print-forest | FileCheck %s +void foo2(int, ...); +// CHECK: translation-unit~simple-declaration := decl-specifier-seq init-declarator-list ; +// CHECK-NEXT: ââdecl-specifier-seq~VOID := +// CHECK-NEXT: ââinit-declarator-list~noptr-declarator := noptr-declarator parameters-and-qualifiers +// CHECK-NEXT: â âânoptr-declarator~IDENTIFIER := +// CHECK-NEXT: â ââparameters-and-qualifiers := ( parameter-declaration-clause ) +// CHECK-NEXT: â ââ( := +// CHECK-NEXT: â ââparameter-declaration-clause := parameter-declaration-list , ... +// CHECK-NEXT: â â ââparameter-declaration-list~INT := +// CHECK-NEXT: â â ââ, := +// CHECK-NEXT: â â ââ... := +// CHECK-NEXT: â ââ) := +// CHECK-NEXT: ââ; := Index: clang-tools-extra/pseudo/lib/cxx.bnf =================================================================== --- clang-tools-extra/pseudo/lib/cxx.bnf +++ clang-tools-extra/pseudo/lib/cxx.bnf @@ -409,7 +409,7 @@ noptr-declarator := noptr-declarator parameters-and-qualifiers noptr-declarator := noptr-declarator [ constant-expression_opt ] noptr-declarator := ( ptr-declarator ) -parameters-and-qualifiers := ( parameter-declaration-list_opt ) cv-qualifier-seq_opt ref-qualifier_opt noexcept-specifier_opt +parameters-and-qualifiers := ( parameter-declaration-clause_opt ) cv-qualifier-seq_opt ref-qualifier_opt noexcept-specifier_opt trailing-return-type := -> type-id ptr-operator := * cv-qualifier-seq_opt ptr-operator := &
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits