[PATCH] D154091: [clang-format] Recognize escape sequences when breaking strings

2023-08-23 Thread sstwcw via Phabricator via cfe-commits
sstwcw abandoned this revision. sstwcw added a comment. I am closing it since no one seems to like it. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D154091/new/ https://reviews.llvm.org/D154091 ___

[PATCH] D154091: [clang-format] Recognize escape sequences when breaking strings

2023-07-06 Thread sstwcw via Phabricator via cfe-commits
sstwcw updated this revision to Diff 537701. sstwcw added a comment. - Add tests for non-whitespace sequences Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D154091/new/ https://reviews.llvm.org/D154091 Files: clang/lib/Format/BreakableToken.cpp

[PATCH] D154091: [clang-format] Recognize escape sequences when breaking strings

2023-07-05 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay added inline comments. Comment at: clang/lib/Format/BreakableToken.cpp:199 +if (EscapeSequence && Advance == 2) { + switch (Text[1]) { sstwcw wrote: > MyDeveloperDay wrote: > > Can we add a unit test for escape sequences > \X which I

[PATCH] D154091: [clang-format] Recognize escape sequences when breaking strings

2023-07-05 Thread sstwcw via Phabricator via cfe-commits
sstwcw added a comment. It won't break the string inside an escape sequence. But escape sequences like `\040`, `\x20`, and `\u0020` don't get recognized as whitespace. Comment at: clang/lib/Format/BreakableToken.cpp:199 +if (EscapeSequence && Advance == 2) { +

[PATCH] D154091: [clang-format] Recognize escape sequences when breaking strings

2023-07-05 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay added inline comments. Comment at: clang/lib/Format/BreakableToken.cpp:199 +if (EscapeSequence && Advance == 2) { + switch (Text[1]) { Can we add a unit test for escape sequences > \X which I assume this handles Repository: rG LLVM

[PATCH] D154091: [clang-format] Recognize escape sequences when breaking strings

2023-07-05 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay added a comment. What would happen for say unicode escapes? x = "XXXThis is a string \u0041 With stuff after"; would it break after the \u? x = "XXXThis is a string \u 0041 With stuff after"; Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D154091: [clang-format] Recognize escape sequences when breaking strings

2023-07-04 Thread sstwcw via Phabricator via cfe-commits
sstwcw marked an inline comment as done. sstwcw added a comment. In D154091#4470158 , @MyDeveloperDay wrote: > What would happen in a \r\n example If the entire `\r\n` part fits on the first line, the break is after `\r\n`. If only the part up to

[PATCH] D154091: [clang-format] Recognize escape sequences when breaking strings

2023-07-04 Thread sstwcw via Phabricator via cfe-commits
sstwcw updated this revision to Diff 537190. sstwcw added a comment. - Add tests for other escape sequences Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D154091/new/ https://reviews.llvm.org/D154091 Files: clang/lib/Format/BreakableToken.cpp

[PATCH] D154091: [clang-format] Recognize escape sequences when breaking strings

2023-07-03 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay added a comment. What would happen in a \r\n example Comment at: clang/lib/Format/BreakableToken.cpp:207 + case 't': + case 'v': +AfterSpace = SplitPoint + 2; Are you testing \r \v \f Repository: rG LLVM Github Monorepo

[PATCH] D154091: [clang-format] Recognize escape sequences when breaking strings

2023-07-01 Thread sstwcw via Phabricator via cfe-commits
sstwcw updated this revision to Diff 536531. sstwcw added a comment. - Add tests for newline outside of column limit Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D154091/new/ https://reviews.llvm.org/D154091 Files:

[PATCH] D154091: [clang-format] Recognize escape sequences when breaking strings

2023-07-01 Thread sstwcw via Phabricator via cfe-commits
sstwcw marked 2 inline comments as done. sstwcw added inline comments. Comment at: clang/lib/Format/BreakableToken.cpp:223 - if (SpaceOffset != 0) -return BreakableToken::Split(SpaceOffset + 1, 0); + if (NewLine != 0) +return BreakableToken::Split(NewLine, 0);

[PATCH] D154091: [clang-format] Recognize escape sequences when breaking strings

2023-07-01 Thread Björn Schäpers via Phabricator via cfe-commits
HazardyKnusperkeks added inline comments. Comment at: clang/lib/Format/BreakableToken.cpp:223 - if (SpaceOffset != 0) -return BreakableToken::Split(SpaceOffset + 1, 0); + if (NewLine != 0) +return BreakableToken::Split(NewLine, 0); What if the new

[PATCH] D154091: [clang-format] Recognize escape sequences when breaking strings

2023-06-30 Thread sstwcw via Phabricator via cfe-commits
sstwcw added a comment. See the updated summary. There does not seem to be an issue on GitHub when I searched. I simply noticed it when reading the code in order to understand how strings got broken. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION