[PATCH] D121678: [pseudo] Split greatergreater token.

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 15 02:15:47 PDT 2022


hokein created this revision.
hokein added a reviewer: sammccall.
Herald added a project: All.
hokein requested review of this revision.
Herald added a subscriber: alextsao1999.
Herald added a project: clang.

For a >> token (a right shift operator, or a nested template?), the clang
lexer always returns a single greatergreater token, as a result,
the grammar-based GLR parser never try to parse the nested template
case.

We derive a token stream by always splitting the >> token, so that the
GLR parser is able to pursue both options during parsing (usually 1
path fails).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D121678

Files:
  clang/include/clang/Tooling/Syntax/Pseudo/Token.h
  clang/lib/Tooling/Syntax/Pseudo/Token.cpp
  clang/lib/Tooling/Syntax/Pseudo/cxx.bnf
  clang/unittests/Tooling/Syntax/Pseudo/TokenTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D121678.415363.patch
Type: text/x-patch
Size: 4966 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220315/3ed0b186/attachment-0001.bin>


More information about the cfe-commits mailing list