[PATCH] D119138: [clang-format] Further improve support for requires expressions

Manuel Klimek via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Nov 26 10:31:55 PST 2022


klimek added a comment.

I changed it in 49aca00d63e14df8bc68fc4329e6cbc9c9805eb8 <https://reviews.llvm.org/rG49aca00d63e14df8bc68fc4329e6cbc9c9805eb8>.

"We" is the people working on clang-format :) I hope that we have a common goal of making clang-format as easy to maintain as we can.

FWIW, I once had the same opinion as you about best doing all parsing as early as possible, but djasper convinced me that the split was a good idea, and in the end, I think it turns out to be significantly less brittle to do more complex annotation in TokenAnnotator. E.g. we now have a lookahead limit of 50, which seems rather arbitrary, while in TokenAnnotator we could simply limit lookahead towards the current UnwrappedLine. Similarly, in TokenAnnotator, we already have all the parens connected, so we could simply look from requires l_paren to the corresponding r_paren and whether the next token is an l_brace. If I can find a bit of time I'll take an attempt at implementing it.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119138/new/

https://reviews.llvm.org/D119138



More information about the cfe-commits mailing list