[PATCH] D30705: clang-format: [JS] allow breaking after non-null assertions.

2017-03-13 Thread Martin Probst via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL297606: clang-format: [JS] allow breaking after non-null assertions. (authored by mprobst). Changed prior to commit: https://reviews.llvm.org/D30705?vs=90988&id=91526#toc Repository: rL LLVM https:/

[PATCH] D30705: clang-format: [JS] allow breaking after non-null assertions.

2017-03-08 Thread Martin Probst via Phabricator via cfe-commits
mprobst updated this revision to Diff 90988. mprobst marked an inline comment as done. mprobst added a comment. - Introduce TT_JsNonNullAssertion to centralize determining token types. - Move up language specific code in determineTokenType. https://reviews.llvm.org/D30705 Files: lib/Format/Fo

[PATCH] D30705: clang-format: [JS] allow breaking after non-null assertions.

2017-03-08 Thread Martin Probst via Phabricator via cfe-commits
mprobst marked 2 inline comments as done. mprobst added inline comments. Comment at: lib/Format/TokenAnnotator.cpp:1056 +} else if (Current.is(tok::exclaim)) { + if (Style.Language == FormatStyle::LK_JavaScript) { +if (Current.Previous && djasper

[PATCH] D30705: clang-format: [JS] allow breaking after non-null assertions.

2017-03-08 Thread Daniel Jasper via Phabricator via cfe-commits
djasper accepted this revision. djasper added inline comments. This revision is now accepted and ready to land. Comment at: lib/Format/TokenAnnotator.cpp:1056 +} else if (Current.is(tok::exclaim)) { + if (Style.Language == FormatStyle::LK_JavaScript) { +if (Curre

[PATCH] D30705: clang-format: [JS] allow breaking after non-null assertions.

2017-03-07 Thread Martin Probst via Phabricator via cfe-commits
mprobst updated this revision to Diff 90889. mprobst added a comment. - Introduce TT_JsNonNullAssertion to centralize determining token types. https://reviews.llvm.org/D30705 Files: lib/Format/FormatToken.h lib/Format/TokenAnnotator.cpp unittests/Format/FormatTestJS.cpp Index: unittests

[PATCH] D30705: clang-format: [JS] allow breaking after non-null assertions.

2017-03-07 Thread Daniel Jasper via Phabricator via cfe-commits
djasper added inline comments. Comment at: lib/Format/TokenAnnotator.cpp:2292 return false; -// Postfix non-null assertion operator, as in `foo!.bar()`. -if (Right.is(tok::exclaim) && (Left.isOneOf(tok::identifier, tok::r_paren, -

[PATCH] D30705: clang-format: [JS] allow breaking after non-null assertions.

2017-03-07 Thread Martin Probst via Phabricator via cfe-commits
mprobst created this revision. Herald added a subscriber: klimek. Previously clang-format would not break after any !. However in TypeScript, ! can be used as a post fix operator for non-nullability: x.foo()!.bar()!; With this change, clang-format will wrap after the ! if it is likely a post-