[PATCH] D139257: [clang-format][NFC] Link braces of a block in UnwrappedLineParser

Owen Pan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Dec 3 07:51:08 PST 2022


owenpan created this revision.
owenpan added reviewers: HazardyKnusperkeks, MyDeveloperDay, rymiel, klimek.
owenpan added a project: clang-format.
Herald added a project: All.
owenpan requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

This includes TT_MacroBlockBegin and TT_MacroBlockEnd as well.

We can no longer use MatchingParen of FormatToken as an indicator to mark optional braces. Instead, we directly set Optional of an l_brace first and reset it later if it turns out that the braces are not optional.

Also added a test case for deeply nested loops.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D139257

Files:
  clang/lib/Format/UnwrappedLineParser.cpp
  clang/unittests/Format/BracesRemoverTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D139257.479838.patch
Type: text/x-patch
Size: 3990 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20221203/e6088b76/attachment.bin>


More information about the cfe-commits mailing list