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

Björn Schäpers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Nov 26 04:26:26 PST 2022


HazardyKnusperkeks added a comment.

In D119138#3951749 <https://reviews.llvm.org/D119138#3951749>, @klimek wrote:

> Generally, why do we need to have that much information? I.e. why do we need to know the exact type of the "requires" keyword?
> I do understand we need to know the brace type, but that seems like it would be easier to figure out in the TokenAnnotator (where we already parsed UnwrappedLines).
> Do we ever parse UnwrappedLines differently depending on requires clauses/expressions?
> If not, we should really do the annotation in TokenAnnotator, where we already have nice parsing bounds from the parsed UnwrappedLines.

Who is //we//, I'm not part of that //we// and haven't heard of some macro improvements. And I don't see how that feature is harming //you//, but be my guest in changing that. If you look into the history of this change I had a heuristic approach which would only look behind to differentiate.

I don't know if that can be solved in the `TokenAnnotator`, but //you// and I have different opinions about that. I'd put more annotating in the `UnwrappedLineParser`, annotate it as soon as we can.

I'll happily review any changes proposed, but I will not rework this piece of code, unless I can see a big flaw in it (which I can't right now).


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