[PATCH] D32733: [clang-format] Convert AlignEscapedNewlinesLeft to an enum, adding DontAlign

2017-05-08 Thread Daniel Jasper via Phabricator via cfe-commits
djasper closed this revision. djasper added a comment. Submitted as r302428. https://reviews.llvm.org/D32733 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D32733: [clang-format] Convert AlignEscapedNewlinesLeft to an enum, adding DontAlign

2017-05-02 Thread Jacob Bandes-Storch via Phabricator via cfe-commits
jtbandes added a comment. In https://reviews.llvm.org/D32733#743116, @djasper wrote: > This is an edge case in actual C++. An escaped newline literally gets > expanded to nothing. So what this reads is > > #define Onetwo \ > ... Yeah, I noticed that, but nonetheless it shouldn't break the

[PATCH] D32733: [clang-format] Convert AlignEscapedNewlinesLeft to an enum, adding DontAlign

2017-05-02 Thread Daniel Jasper via Phabricator via cfe-commits
djasper accepted this revision. djasper added a comment. This revision is now accepted and ready to land. This is an edge case in actual C++. An escaped newline literally gets expanded to nothing. So what this reads is #define Onetwo \ ... https://reviews.llvm.org/D32733

[PATCH] D32733: [clang-format] Convert AlignEscapedNewlinesLeft to an enum, adding DontAlign

2017-05-02 Thread Jacob Bandes-Storch via Phabricator via cfe-commits
jtbandes marked an inline comment as done. jtbandes added a comment. This seems to work fine. Separately I noticed a strange edge case, which I think is an existing bug: #define One\ two \ three;

[PATCH] D32733: [clang-format] Convert AlignEscapedNewlinesLeft to an enum, adding DontAlign

2017-05-02 Thread Jacob Bandes-Storch via Phabricator via cfe-commits
jtbandes updated this revision to Diff 97404. jtbandes added a comment. Modified `appendNewlineText` so we can simply `return` in the DontAlign case. https://reviews.llvm.org/D32733 Files: include/clang/Format/Format.h lib/Format/Format.cpp lib/Format/WhitespaceManager.cpp

[PATCH] D32733: [clang-format] Convert AlignEscapedNewlinesLeft to an enum, adding DontAlign

2017-05-02 Thread Jacob Bandes-Storch via Phabricator via cfe-commits
jtbandes added inline comments. Comment at: lib/Format/WhitespaceManager.cpp:523 + if (C.NewlinesBefore > 0 && C.ContinuesPPDirective) +C.EscapedNewlineColumn = C.PreviousEndOfTokenColumn + 2; +return; djasper wrote: > I think we should not

[PATCH] D32733: [clang-format] Convert AlignEscapedNewlinesLeft to an enum, adding DontAlign

2017-05-02 Thread Daniel Jasper via Phabricator via cfe-commits
djasper added inline comments. Comment at: lib/Format/WhitespaceManager.cpp:523 + if (C.NewlinesBefore > 0 && C.ContinuesPPDirective) +C.EscapedNewlineColumn = C.PreviousEndOfTokenColumn + 2; +return; I think we should not duplicate this loop.

[PATCH] D32733: [clang-format] Convert AlignEscapedNewlinesLeft to an enum, adding DontAlign

2017-05-02 Thread Jacob Bandes-Storch via Phabricator via cfe-commits
jtbandes created this revision. Herald added a subscriber: klimek. This converts the clang-format option `AlignEscapedNewlinesLeft` from a boolean to an enum, named `AlignEscapedNewlines`, with options `Left` (prev. `true`), `Right` (prev. `false`), and a new option `DontAlign`. When set to