benhamilton added inline comments.
================
Comment at: lib/Format/UnwrappedLineParser.cpp:2137
+ do {
+ if (FormatTok->Tok.isOneOf(tok::semi, tok::r_brace)) {
+ nextToken();
----------------
jolesiak wrote:
> `tok::r_brace` could be skiped - see comment to line 2143.
Done.
================
Comment at: lib/Format/UnwrappedLineParser.cpp:2143
+ parseBlock(/*MustBeDeclaration=*/false);
+ addUnwrappedLine();
+ } else {
----------------
jolesiak wrote:
> We have to add `return` after `addUnwrappedLine` as `parseBlock` does consume
> `tok::r_brace`. Without `return` we will consume tokens after `}`. This
> problem will rarely occur as most lines end with `tok::semi` or
> `tok::r_brace` and it will be terminated properly (however maybe not handled
> properly as we just skip every token in `else`) by `if` branch.
>
> Test like:
> ```
> @implementation Foo
> - (foo)foo {
> }
> @end
> @implementation Bar
> - (bar)bar {
> }
> @end
> ```
> will distinguish version with `return` from one without. Therefore, I think
> we should add it.
Done, test added.
Repository:
rC Clang
https://reviews.llvm.org/D47095
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits