[pseudo] Eliminate the dangling-else syntax ambiguity.
authorHaojian Wu <hokein.wu@gmail.com>
Thu, 21 Jul 2022 08:18:33 +0000 (10:18 +0200)
committerHaojian Wu <hokein.wu@gmail.com>
Fri, 22 Jul 2022 07:13:09 +0000 (09:13 +0200)
commit2a88fb2ecb72300bfbbc74c586fb415cc18c9f9d
treef8711ab1aca12afd44d84535261bc48901be11cc
parent9daf945367044927f92d5cfd4bf2e94352c067fa
[pseudo] Eliminate the dangling-else syntax ambiguity.

- the grammar ambiguity is eliminated by a guard;
- modify the guard function signatures, now all parameters are folded in
  to a single object, avoid a long parameter list (as we will add more
  parameters in the near future);

Reviewed By: sammccall

Differential Revision: https://reviews.llvm.org/D130160
clang-tools-extra/pseudo/include/clang-pseudo/Language.h
clang-tools-extra/pseudo/lib/GLR.cpp
clang-tools-extra/pseudo/lib/cxx/CXX.cpp
clang-tools-extra/pseudo/lib/cxx/cxx.bnf
clang-tools-extra/pseudo/test/cxx/dangling-else.cpp [new file with mode: 0644]
clang-tools-extra/pseudo/unittests/GLRTest.cpp