This is an archive of the discontinued LLVM Phabricator instance.

[clang-format] PROPOSAL - WIP: Added ability to parse template arguments
Changes PlannedPublic

Authored by HazardyKnusperkeks on Feb 17 2022, 3:13 AM.

Details

Summary

Obviously not implemented yet.

For https://github.com/llvm/llvm-project/issues/53864 I need to get the end of the requires clause at the end of the nested template. But parseBracedList() just ends on the first > it finds.

Simply extending it the be recursive on < wouldn't work, since we have to determine if < is a less or a template opener. Analogous for >. Currently we have TokenAnnotator::parseAngle to deal with this stuff. Including // FIXME: This is getting out of hand, write a decent parser.

So my proposal is to add this parsing in UnwrappedLineParser and set TT_TemplateOpener and TT_TempalteCloser already there.

This is going to be a huge change, so I ask for your opinion before I put a lot of effort into that.

Diff Detail

Event Timeline

HazardyKnusperkeks requested review of this revision.Feb 17 2022, 3:13 AM
HazardyKnusperkeks created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptFeb 17 2022, 3:13 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript

A noble effort. It needs someone like yourself to do this as you already have a deep understanding.

That would be a nice improvement... and a big undertaking at the same time. You have my blessing!

HazardyKnusperkeks planned changes to this revision.Feb 20 2022, 2:11 PM