This is an archive of the discontinued LLVM Phabricator instance.

Correctly handle escaped newlines when the next token starts without a space.
ClosedPublic

Authored by klimek on Apr 11 2014, 3:01 AM.

Details

Reviewers
djasper
Summary

We will need this to correctly handle conflict markers inside macro
definitions. Currently the tests as written fail directly when inserting
a space after the \\\n.

Diff Detail

Event Timeline

djasper accepted this revision.Apr 11 2014, 3:24 AM

I am generally fine with this, as it seems irrelevant in practice. It seems weird, however, to replace an escaped newline with a newline.

unittests/Format/FormatTest.cpp
749–750 ↗(On Diff #8472)

I find these tests easier to read if the strings are split after each \n.

Also, while I don't see a practical use here, I don't think simply removing the escaped newline is the right thing to do here. What other purpose can it have, other than being a notion of "the following comment is bound to this"? But if implementing that is extra effort, I don't care.

934 ↗(On Diff #8472)

Same here.

I think here it is even worse as the test makes no sense whatsoever unless we also change the content of the comment. If we decided to keep this, maybe we should just remove/replace these tests?

klimek updated this revision to Unknown Object (????).Apr 11 2014, 5:25 AM

Now without changes to the tests...

klimek closed this revision.Apr 11 2014, 5:35 AM