This is an archive of the discontinued LLVM Phabricator instance.

clang-format: Add basic support for try and catch statements
AbandonedPublic

Authored by sdt on Feb 10 2014, 1:28 PM.

Details

Reviewers
None
Summary

This patch adds parsing of try and catch statements to LibFormat, respecting the break before brace style as appropriate.

Diff Detail

Event Timeline

First of all, thank you for working on this!

There is already another patch out there that is doing the same thing: http://llvm-reviews.chandlerc.com/D2555. Not quite sure how to move forward. I'll ping that patch once more and pick it up if nothing happens. Generally:

  • I think it doesn't really make sense to parse try and cat independently. Especially, many coding styles require the "}" on the same line as the following "catch".
  • We have a unit testing infrastructure in cfe/unittests/Format/FormatTest.cpp, which we prefer over the file-check-based tests for various reasons.
sdt added a comment.Feb 10 2014, 3:26 PM

Hah, I'm not surprised someone's already taken a stab at this. OK, I'll look at that patch; perhaps I can finish that one up.

Thanks for pointing me to the correct place to do testing (I was a bit surprised by the sparseness of the FileCheck tests :)).

djasper requested changes to this revision.May 8 2014, 5:06 AM
djasper edited edge metadata.

I think this is now obsolete. I submitted a version of the other patch as r208302.

This revision now requires changes to proceed.May 8 2014, 5:06 AM
djasper resigned from this revision.May 22 2014, 4:56 AM
djasper removed a reviewer: djasper.
sdt abandoned this revision.Dec 2 2014, 3:26 PM