[clang] [clang][Preprocessor] Add peekNextPPToken, makes look ahead next token without side-effects (PR #143898)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 12 08:50:49 PDT 2025


https://github.com/erichkeane commented:

I find myself wondering based on the patch: DO we actually care about the token itself, or just the kind? Could we instead have `peekNextPPToken` instead be `peekNextPPTokenKind` and just return the next token kind?

That way we don't need the optional, and can just do a direct comparison.  We could also just return the `eof` as well rather than treating that as a nullopt.

WDYT?

https://github.com/llvm/llvm-project/pull/143898


More information about the cfe-commits mailing list