mprobst added a comment.
Nice, great to see this.
Comment at: lib/Format/ContinuationIndenter.cpp:330
@@ -329,3 +329,3 @@
- if (Style.AlignAfterOpenBracket && Previous.opensScope() &&
- Previous.isNot(TT_ObjCMethodExpr) &&
+ if (Style.AlignAfterOpenBracket ==
mprobst accepted this revision.
mprobst added a comment.
This revision is now accepted and ready to land.
LGTM.
http://reviews.llvm.org/D14104
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
mprobst updated this revision to Diff 37447.
mprobst added a comment.
Simplified escape handling.
http://reviews.llvm.org/D13765
Files:
lib/Format/Format.cpp
unittests/Format/FormatTestJS.cpp
Index: unittests/Format/FormatTestJS.cpp
mprobst added inline comments.
Comment at: lib/Format/Format.cpp:858
@@ +857,3 @@
+}
+if (Prev) {
+ if (Prev->isOneOf(tok::plus, tok::plusplus, tok::minus,
djasper wrote:
> I'd probably put this into the other two conditions to reduce indentation.
>
mprobst updated this revision to Diff 37654.
mprobst marked 3 inline comments as done.
mprobst added a comment.
- add test for if (...) /re/;
- address minor review comments
- fix unary handling.
http://reviews.llvm.org/D13765
Files:
lib/Format/Format.cpp
unittests/Format/FormatTestJS.cpp
mprobst added inline comments.
Comment at: lib/Format/Format.cpp:757
@@ -756,3 +756,1 @@
- if (tryMergeEscapeSequence())
-return;
if (tryMergeTemplateString())
You cannot actually escape in a template string - backslashes in them are
literal
mprobst updated this revision to Diff 37695.
mprobst marked 3 inline comments as done.
mprobst added a comment.
- add test
- review comments, fix unary handling.
- Extract canPrecedeRegexLiteral function.
http://reviews.llvm.org/D13765
Files:
lib/Format/Format.cpp
mprobst added inline comments.
Comment at: lib/Format/Format.cpp:860
@@ +859,3 @@
+}
+if (Prev) {
+ if (Prev->isOneOf(tok::plusplus, tok::minusminus)) {
djasper wrote:
> I understand and I actually find that hard to understand. I think a better
>
mprobst created this revision.
mprobst added a reviewer: djasper.
mprobst added subscribers: klimek, cfe-commits.
If a RegExp contains a character group with a quote (`/["]/`), the
trailing end of it is first tokenized as a string literal, which leads
to the merging code seeing an unbalanced
mprobst created this revision.
mprobst added a reviewer: djasper.
mprobst added subscribers: cfe-commits, klimek.
Slashes in regular expressions do not need to be escaped and do not terminate
the regular expression even without a preceding backslash.
http://reviews.llvm.org/D13641
Files:
mprobst created this revision.
mprobst added reviewers: djasper, klimek.
mprobst added a subscriber: cfe-commits.
Herald added a subscriber: klimek.
JavaScript allows keywords to appear in IdenfierName positions, e.g. fields, or
object literal members, but not as plain identifiers.
mprobst updated this revision to Diff 35867.
mprobst marked an inline comment as done.
mprobst added a comment.
Use isOneOf instead of startsWith.
http://reviews.llvm.org/D13211
Files:
lib/Format/FormatToken.h
lib/Format/TokenAnnotator.cpp
lib/Format/UnwrappedLineParser.cpp
mprobst created this revision.
mprobst added reviewers: klimek, djasper.
mprobst added a subscriber: cfe-commits.
Herald added a subscriber: klimek.
clang-format: [JS] handle let (ES6).
http://reviews.llvm.org/D13211
Files:
lib/Format/FormatToken.h
lib/Format/TokenAnnotator.cpp
mprobst created this revision.
mprobst added a reviewer: djasper.
mprobst added subscribers: cfe-commits, alexeagle.
Herald added a subscriber: klimek.
There's no convention of avoiding the nested indentation.
http://reviews.llvm.org/D21275
Files:
lib/Format/Format.cpp
mprobst created this revision.
mprobst added a reviewer: djasper.
mprobst added a subscriber: cfe-commits.
Herald added a subscriber: klimek.
When turned on, clang-format wraps JavaScript imports (and importing exports),
instead of forcing the entire import statement onto one line.
This revision was automatically updated to reflect the committed changes.
Closed by commit rL272524: clang-format: [JS] post-fix non-null assertion
operator. (authored by mprobst).
Changed prior to commit:
http://reviews.llvm.org/D21204?vs=60311=60482#toc
Repository:
rL LLVM
Author: mprobst
Date: Sun Jun 12 19:49:54 2016
New Revision: 272524
URL: http://llvm.org/viewvc/llvm-project?rev=272524=rev
Log:
clang-format: [JS] post-fix non-null assertion operator.
Summary:
Do not insert whitespace preceding the "!" postfix operator. This is an
incomplete fix, but should
mprobst created this revision.
mprobst added a reviewer: djasper.
mprobst added a subscriber: cfe-commits.
Herald added a subscriber: klimek.
Do not insert whitespace preceding the "!" postfix operator. This is an
incomplete fix, but should cover common usage.
http://reviews.llvm.org/D21204
mprobst created this revision.
mprobst added a reviewer: djasper.
mprobst added a subscriber: cfe-commits.
Herald added a subscriber: klimek.
This also fixes union type formatting in function parameter types.
http://reviews.llvm.org/D21206
Files:
lib/Format/TokenAnnotator.cpp
This revision was automatically updated to reflect the committed changes.
Closed by commit rL272330: clang-format: [JS] recognized named functions in
AnnotatingParser. (authored by mprobst).
Changed prior to commit:
http://reviews.llvm.org/D21206?vs=60254=60268#toc
Repository:
rL LLVM
Author: mprobst
Date: Thu Jun 9 17:49:04 2016
New Revision: 272330
URL: http://llvm.org/viewvc/llvm-project?rev=272330=rev
Log:
clang-format: [JS] recognized named functions in AnnotatingParser.
Summary: This also fixes union type formatting in function parameter types.
Before: function
mprobst updated this revision to Diff 60308.
mprobst marked an inline comment as done.
mprobst added a comment.
- invert check to whitelist known tokens that can precede a non-null assertion.
http://reviews.llvm.org/D21204
Files:
lib/Format/TokenAnnotator.cpp
mprobst added inline comments.
Comment at: lib/Format/TokenAnnotator.cpp:2127
@@ +2126,3 @@
+// Postfix non-null assertion operator, as in `foo!.bar()`.
+if (Right.is(tok::exclaim) && Right.Next &&
+Right.Next->isNot(tok::identifier) &&
mprobst updated this revision to Diff 60311.
mprobst added a comment.
- more tests
http://reviews.llvm.org/D21204
Files:
lib/Format/TokenAnnotator.cpp
unittests/Format/FormatTestJS.cpp
Index: unittests/Format/FormatTestJS.cpp
mprobst added inline comments.
Comment at: lib/Format/TokenAnnotator.cpp:2128
@@ +2127,3 @@
+if (Right.is(tok::exclaim) && (Left.isOneOf(tok::identifier, tok::r_paren,
+tok::r_square, tok::r_brace) ||
+
mprobst created this revision.
mprobst added a reviewer: djasper.
mprobst added a subscriber: cfe-commits.
Herald added a subscriber: klimek.
Shebang lines (`#!/bin/blah`) can be used in JavaScript scripts to indicate
they should be run using e.g. node. This change treats # lines on the first
mprobst added a comment.
How would I disable the formatting using that way?
When I special case `parsePreprocessorDirective()`, consume the line, and
return `LT_ImportStatement`, clang-format still tries to format tokens within
the shebang. E.g. I get `#!/usr/bin / env node`, note the
mprobst updated this revision to Diff 58529.
mprobst added a comment.
- use #include style shebang parsing.
http://reviews.llvm.org/D20632
Files:
lib/Format/FormatTokenLexer.cpp
lib/Format/TokenAnnotator.cpp
unittests/Format/FormatTestJS.cpp
Index: unittests/Format/FormatTestJS.cpp
mprobst marked 2 inline comments as done.
Comment at: lib/Format/TokenAnnotator.cpp:698
@@ +697,3 @@
+
+if (Style.Language == FormatStyle::LK_JavaScript) {
+ // JavaScript files can contain shebang lines of the form:
alexeagle wrote:
> should we still
mprobst updated this revision to Diff 58612.
mprobst marked an inline comment as done.
mprobst added a comment.
revert FormatTokenLexer, restrict to first token
http://reviews.llvm.org/D20632
Files:
lib/Format/FormatToken.h
lib/Format/TokenAnnotator.cpp
unittests/Format/FormatTestJS.cpp
Author: mprobst
Date: Mon Jun 13 11:41:28 2016
New Revision: 272559
URL: http://llvm.org/viewvc/llvm-project?rev=272559=rev
Log:
clang-format: [JS] Indent namespaces in JavaScript/TS by default.
Summary: There's no convention of avoiding the nested indentation.
Reviewers: djasper
Subscribers:
This revision was automatically updated to reflect the committed changes.
Closed by commit rL272558: clang-format: [JS] Introduce JavaScriptWrapImports
option. (authored by mprobst).
Changed prior to commit:
http://reviews.llvm.org/D21273?vs=60532=60552#toc
Repository:
rL LLVM
Author: mprobst
Date: Mon Jun 13 11:39:50 2016
New Revision: 272558
URL: http://llvm.org/viewvc/llvm-project?rev=272558=rev
Log:
clang-format: [JS] Introduce JavaScriptWrapImports option.
Summary:
When turned on, clang-format wraps JavaScript imports (and importing exports),
instead of forcing
mprobst updated this revision to Diff 60519.
mprobst added a comment.
- rename to JavaScriptWrapImports
- re-alphabetize options list
http://reviews.llvm.org/D21273
Files:
include/clang/Format/Format.h
lib/Format/Format.cpp
lib/Format/TokenAnnotator.cpp
Author: mprobst
Date: Mon Jun 13 12:50:10 2016
New Revision: 272569
URL: http://llvm.org/viewvc/llvm-project?rev=272569=rev
Log:
clang-format: [JS] Initialize new configuration value.
Modified:
cfe/trunk/lib/Format/Format.cpp
Modified: cfe/trunk/lib/Format/Format.cpp
URL:
mprobst updated this revision to Diff 60532.
mprobst added a comment.
- classify as LT_ImportStatement, re-enable wrapping later
- no early exist in TokenAnnotator: while loop is required for consumeToken().
http://reviews.llvm.org/D21273
Files:
include/clang/Format/Format.h
This revision was automatically updated to reflect the committed changes.
Closed by commit rL272559: clang-format: [JS] Indent namespaces in
JavaScript/TS by default. (authored by mprobst).
Changed prior to commit:
http://reviews.llvm.org/D21275?vs=60487=60553#toc
Repository:
rL LLVM
Author: mprobst
Date: Wed Jun 8 09:04:04 2016
New Revision: 272142
URL: http://llvm.org/viewvc/llvm-project?rev=272142=rev
Log:
clang-format: [JS] fix an assertion failure caused by shrinking sources.
Summary:
The JavaScript import sorter has a corner condition that can cause the overall
source
Author: mprobst
Date: Wed Jun 8 09:05:26 2016
New Revision: 272143
URL: http://llvm.org/viewvc/llvm-project?rev=272143=rev
Log:
clang-format: [JS] fix a FIXME.
Modified:
cfe/trunk/lib/Format/SortJavaScriptImports.cpp
Modified: cfe/trunk/lib/Format/SortJavaScriptImports.cpp
URL:
mprobst updated this revision to Diff 58809.
mprobst added a comment.
- fix description
http://reviews.llvm.org/D20737
Files:
lib/Format/FormatToken.h
lib/Format/TokenAnnotator.h
lib/Format/UnwrappedLineParser.cpp
unittests/Format/FormatTestJS.cpp
Index:
mprobst created this revision.
mprobst added a reviewer: djasper.
mprobst added a subscriber: cfe-commits.
Herald added a subscriber: klimek.
Refactors AnnotatedLine.startsWith/endsWith by extracting the core functionality
into FormatToken.startsSequence/endsSequence. This allows checking tokens
This revision was automatically updated to reflect the committed changes.
Closed by commit rL271401: clang-format: [JS] no ASI on `import {x as\n y}`.
(authored by mprobst).
Changed prior to commit:
http://reviews.llvm.org/D20817?vs=59074=59227#toc
Repository:
rL LLVM
Author: mprobst
Date: Wed Jun 1 10:19:53 2016
New Revision: 271400
URL: http://llvm.org/viewvc/llvm-project?rev=271400=rev
Log:
clang-format: [JS] Sort imported symbols.
Summary: E.g. sort `import {b, a} from 'x';` into `import {a, b} from 'x';`.
Reviewers: djasper
Subscribers: cfe-commits,
mprobst marked an inline comment as done.
mprobst added a comment.
http://reviews.llvm.org/D20798
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL271400: clang-format: [JS] Sort imported symbols. (authored
by mprobst).
Changed prior to commit:
http://reviews.llvm.org/D20798?vs=59070=59226#toc
Repository:
rL LLVM
Author: mprobst
Date: Wed Jun 1 10:22:47 2016
New Revision: 271401
URL: http://llvm.org/viewvc/llvm-project?rev=271401=rev
Log:
clang-format: [JS] no ASI on `import {x as\n y}`.
Summary: ASI did not handle the ES6 `as` operator correctly.
Reviewers: djasper
Subscribers: klimek, cfe-commits
mprobst created this revision.
mprobst added a reviewer: djasper.
mprobst added a subscriber: cfe-commits.
Herald added a subscriber: klimek.
ASI did not handle the ES6 `as` operator correctly.
http://reviews.llvm.org/D20817
Files:
lib/Format/UnwrappedLineParser.cpp
mprobst updated this revision to Diff 59001.
mprobst added a comment.
- extract method for readability
http://reviews.llvm.org/D20798
Files:
lib/Format/Format.cpp
lib/Format/SortJavaScriptImports.cpp
unittests/Format/SortImportsTestJS.cpp
Index: unittests/Format/SortImportsTestJS.cpp
mprobst created this revision.
mprobst added a reviewer: djasper.
mprobst added a subscriber: cfe-commits.
Herald added a subscriber: klimek.
E.g. sort `import {b, a} from 'x';` into `import {a, b} from 'x';`.
http://reviews.llvm.org/D20798
Files:
lib/Format/Format.cpp
mprobst updated this revision to Diff 59070.
mprobst added a comment.
- multiline tests, review comments
http://reviews.llvm.org/D20798
Files:
lib/Format/Format.cpp
lib/Format/SortJavaScriptImports.cpp
unittests/Format/SortImportsTestJS.cpp
Index: unittests/Format/SortImportsTestJS.cpp
mprobst marked 4 inline comments as done.
mprobst added a comment.
Done regarding the tests. We do have an unrelated issue with formatting `import
{x as foo}`, will send a fix later.
http://reviews.llvm.org/D20798
___
cfe-commits mailing list
mprobst added a comment.
Done regarding the tests. We do have an unrelated issue with formatting `import
{x as foo}`, will send a fix later.
http://reviews.llvm.org/D20798
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
This revision was automatically updated to reflect the committed changes.
Closed by commit rL271184: clang-format: [JS] fix async parsing. (authored by
mprobst).
Changed prior to commit:
http://reviews.llvm.org/D20737?vs=58809=58915#toc
Repository:
rL LLVM
http://reviews.llvm.org/D20737
Author: mprobst
Date: Sun May 29 09:41:07 2016
New Revision: 271184
URL: http://llvm.org/viewvc/llvm-project?rev=271184=rev
Log:
clang-format: [JS] fix async parsing.
Summary:
Only treat the sequence `async function` as the start of a function expression,
as opposed to every occurrence of the
Author: mprobst
Date: Sun May 29 09:41:36 2016
New Revision: 271185
URL: http://llvm.org/viewvc/llvm-project?rev=271185=rev
Log:
clang-format: [JS] Support shebang lines on the very first line.
Summary:
Shebang lines (`#!/bin/blah`) can be used in JavaScript scripts to indicate
they should be
Author: mprobst
Date: Sun May 29 09:41:02 2016
New Revision: 271183
URL: http://llvm.org/viewvc/llvm-project?rev=271183=rev
Log:
clang-format: [JS] FormatToken.startsSequence/endsSequence.
Refactors AnnotatedLine.startsWith/endsWith by extracting the core functionality
into
This revision was automatically updated to reflect the committed changes.
Closed by commit rL271185: clang-format: [JS] Support shebang lines on the very
first line. (authored by mprobst).
Changed prior to commit:
http://reviews.llvm.org/D20632?vs=58612=58916#toc
Repository:
rL LLVM
mprobst added inline comments.
Comment at: lib/Format/TokenAnnotator.cpp:480
@@ -471,1 +479,3 @@
+ void parseJSTypeDefinition() {
+// `type Name = Type Expression;`
djasper wrote:
> Why is this necessary?
It is not, actually. I was chasing a wrong path
Author: mprobst
Date: Wed Jun 22 09:35:14 2016
New Revision: 273422
URL: http://llvm.org/viewvc/llvm-project?rev=273422=rev
Log:
clang-format: [JS] Do not break before 'as'.
Summary:
'as' is a pseudo operator, so automatic semicolon insertion kicks in and the
code fails to part.
Reviewers:
mprobst updated this revision to Diff 61548.
mprobst added a comment.
- Remove parseJSTypeDefinition
http://reviews.llvm.org/D21597
Files:
lib/Format/FormatToken.h
lib/Format/TokenAnnotator.cpp
unittests/Format/FormatTestJS.cpp
Index: unittests/Format/FormatTestJS.cpp
mprobst added a comment.
This seems to be getting a bit tricky with the declaration contexts. If you
have a better suggestion, please come forward.
http://reviews.llvm.org/D21597
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
mprobst created this revision.
mprobst added a reviewer: djasper.
mprobst added a subscriber: cfe-commits.
Herald added a subscriber: klimek.
Includes parenthesized type expressions and type aliases.
http://reviews.llvm.org/D21597
Files:
lib/Format/FormatToken.h
mprobst updated this revision to Diff 61706.
mprobst marked an inline comment as done.
mprobst added a comment.
- progress
http://reviews.llvm.org/D21597
Files:
lib/Format/FormatToken.h
lib/Format/TokenAnnotator.cpp
unittests/Format/FormatTestJS.cpp
Index:
mprobst marked 2 inline comments as done.
Comment at: lib/Format/TokenAnnotator.cpp:155
@@ +154,3 @@
+} else if (Style.Language == FormatStyle::LK_JavaScript && Left->Previous
&&
+ Left->Previous->is(TT_JsTypeColon)) {
+ // let x: (SomeType);
This revision was automatically updated to reflect the committed changes.
Closed by commit rL273603: clang-format: [JS] recognize more type locations.
(authored by mprobst).
Changed prior to commit:
http://reviews.llvm.org/D21597?vs=61706=61711#toc
Repository:
rL LLVM
Author: mprobst
Date: Thu Jun 23 14:52:32 2016
New Revision: 273603
URL: http://llvm.org/viewvc/llvm-project?rev=273603=rev
Log:
clang-format: [JS] recognize more type locations.
Summary: Includes parenthesized type expressions and type aliases.
Reviewers: djasper
Subscribers: klimek,
mprobst created this revision.
mprobst added a reviewer: djasper.
mprobst added a subscriber: cfe-commits.
Herald added a subscriber: klimek.
This causes a regression for top level ternary expressions, but that's deemed
acceptable, as those really should be very rare.
Author: mprobst
Date: Fri Jun 24 12:45:13 2016
New Revision: 273694
URL: http://llvm.org/viewvc/llvm-project?rev=273694=rev
Log:
clang-format: [JS] Fix build breakage.
Checking Line.MustBeDeclaration does actually break the field and param
initializer use case.
Modified:
mprobst created this revision.
mprobst added a reviewer: djasper.
mprobst added a subscriber: cfe-commits.
Herald added a subscriber: klimek.
Checking Line.MustBeDeclaration does actually break the field and param
initializer use case.
http://reviews.llvm.org/D21691
Files:
mprobst updated this revision to Diff 61726.
mprobst added a comment.
ok
http://reviews.llvm.org/D21658
Files:
lib/Format/TokenAnnotator.cpp
unittests/Format/FormatTestJS.cpp
Index: unittests/Format/FormatTestJS.cpp
===
---
Author: mprobst
Date: Thu Jun 23 16:51:49 2016
New Revision: 273619
URL: http://llvm.org/viewvc/llvm-project?rev=273619=rev
Log:
clang-format: [JS] handle conditionals in fields, default params.
Summary:
Reviewers: djasper
Subscribers: klimek, cfe-commits
Differential Revision:
This revision was automatically updated to reflect the committed changes.
Closed by commit rL273619: clang-format: [JS] handle conditionals in fields,
default params. (authored by mprobst).
Changed prior to commit:
http://reviews.llvm.org/D21658?vs=61726=61729#toc
Repository:
rL LLVM
The patch description seems wrong as this doesn't fix a build breakage
> AFAICT. Do you mean a test failure? If so, it would be helpful to #include
> what's actually changing (before/after or calling out the failing test case
> or something).
>
>
> On Fri, Jun 24, 2016 at 7:45 PM, Ma
mprobst marked an inline comment as done.
Comment at: lib/Format/Format.cpp:1579
@@ +1578,3 @@
+ // The width of the extra \ escapes is taken into account in getNextToken.
+ void requoteJSStringLiterals(tooling::Replacements ,
+ FormatToken
mprobst updated this revision to Diff 48946.
mprobst marked an inline comment as done.
mprobst added a comment.
- Move code closer together by piping Replacements into the FormatTokenLexer.
- remove sstream import
http://reviews.llvm.org/D17385
Files:
lib/Format/Format.cpp
>
> Nice, the behavior now seems nicely isolated. Is this a purely stylistic
> kind of change or do you think every JS developer working on any kind of
> codebase will want it? Generally this feels like something we should
> carefully enable with a dedicated style option. Where can I find more
>
mprobst updated this revision to Diff 49214.
mprobst added a comment.
- Move code closer together by piping Replacements into the FormatTokenLexer.
- remove sstream import
- * Treat JavaScript single quoted string literals as tok::string_literal, not
http://reviews.llvm.org/D17385
Files:
mprobst created this revision.
mprobst added a reviewer: djasper.
mprobst added a subscriber: cfe-commits.
Herald added a subscriber: klimek.
http://reviews.llvm.org/D17385
Files:
lib/Format/Format.cpp
unittests/Format/FormatTestJS.cpp
Index: unittests/Format/FormatTestJS.cpp
mprobst updated this revision to Diff 48338.
mprobst added a comment.
Fixed typo.
http://reviews.llvm.org/D17385
Files:
lib/Format/Format.cpp
unittests/Format/FormatTestJS.cpp
Index: unittests/Format/FormatTestJS.cpp
===
---
mprobst created this revision.
mprobst added a reviewer: djasper.
mprobst added subscribers: cfe-commits, klimek.
"import ... from '...';" and "export ... from '...';" should be treated the same
as goog.require/provide/module/forwardDeclare calls.
http://reviews.llvm.org/D17440
Files:
mprobst created this revision.
mprobst added a reviewer: djasper.
mprobst added subscribers: cfe-commits, klimek.
http://reviews.llvm.org/D17439
Files:
lib/Format/TokenAnnotator.cpp
unittests/Format/FormatTestJS.cpp
Index: unittests/Format/FormatTestJS.cpp
mprobst added a comment.
FYI this should not be submitted yet, there are still style discussions going
on.
http://reviews.llvm.org/D17440
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
mprobst updated this revision to Diff 49569.
mprobst marked an inline comment as done.
mprobst added a comment.
- Move code closer together by piping Replacements into the FormatTokenLexer.
- remove sstream import
- * Treat JavaScript single quoted string literals as tok::string_literal, not
-
mprobst added inline comments.
Comment at: lib/Format/Format.cpp:1087
@@ +1086,3 @@
+(Style.Quotes == FormatStyle::QS_Single &&
+ !FormatTok->TokenText.startswith("\"")) ||
+(Style.Quotes == FormatStyle::QS_Double &&
djasper wrote:
> Are
mprobst updated this revision to Diff 49562.
mprobst marked 6 inline comments as done.
mprobst added a comment.
- Move code closer together by piping Replacements into the FormatTokenLexer.
- remove sstream import
- * Treat JavaScript single quoted string literals as tok::string_literal, not
-
mprobst updated this revision to Diff 50537.
mprobst added a comment.
- Handle unary !.
- Address review comments.
- Support declarations and statements in ASI.
http://reviews.llvm.org/D17910
Files:
lib/Format/UnwrappedLineParser.cpp
lib/Format/UnwrappedLineParser.h
Author: mprobst
Date: Mon Apr 11 02:35:57 2016
New Revision: 265916
URL: http://llvm.org/viewvc/llvm-project?rev=265916=rev
Log:
clang-format: [JS] do not insert semicolons after wrapped annotations.
Reviewers: djasper
Subscribers: klimek
Differential Revision: http://reviews.llvm.org/D18943
Author: mprobst
Date: Mon Apr 11 04:17:57 2016
New Revision: 265922
URL: http://llvm.org/viewvc/llvm-project?rev=265922=rev
Log:
clang-format: [JS] Test for parameter annotations.
Summary: Just to ensure no regressions, this already works fine.
Reviewers: djasper
Subscribers: cfe-commits,
mprobst created this revision.
mprobst added a reviewer: djasper.
mprobst added a subscriber: cfe-commits.
Herald added a subscriber: klimek.
Just to ensure no regressions, this already works fine.
http://reviews.llvm.org/D18950
Files:
unittests/Format/FormatTestJS.cpp
Index:
This revision was automatically updated to reflect the committed changes.
mprobst marked an inline comment as done.
Closed by commit rL265916: clang-format: [JS] do not insert semicolons after
wrapped annotations. (authored by mprobst).
Changed prior to commit:
This revision was automatically updated to reflect the committed changes.
Closed by commit rL265922: clang-format: [JS] Test for parameter annotations.
(authored by mprobst).
Changed prior to commit:
http://reviews.llvm.org/D18950?vs=53201=53205#toc
Repository:
rL LLVM
mprobst updated this revision to Diff 53190.
mprobst added a comment.
- simplify conditions
http://reviews.llvm.org/D18943
Files:
lib/Format/UnwrappedLineParser.cpp
unittests/Format/FormatTestJS.cpp
Index: unittests/Format/FormatTestJS.cpp
mprobst marked 2 inline comments as done.
Comment at: unittests/Format/FormatTestJS.cpp:689
@@ -688,1 +688,3 @@
"String");
+ verifyFormat("function f(@Foo bar) {}", "function f(@Foo\n"
+ " bar)
mprobst marked an inline comment as done.
Comment at: lib/Format/UnwrappedLineParser.cpp:708
@@ +707,3 @@
+ if (Line && Line->Tokens.size() > 1) {
+// If the token before the previous one is an '@', the previous token is an
+// annotation and can precede another
>
> > Was/is the 2 correct then? (if it was next(rbegin, 2) that'd be
> equivalent
> > to prev(end, 3), yes?)
>
> I think it is from looking at the test case, looping in martin to see
> whether I'm right :)
At that point in the code, we have [..., PrePrev = '@', Prev = 'SomeToken']
and
mprobst created this revision.
mprobst added a reviewer: djasper.
mprobst added a subscriber: cfe-commits.
Herald added a subscriber: klimek.
| and & in types, as opposed to the bitwise operators, should not have
whitespace around them (e.g. `Foo`).
http://reviews.llvm.org/D18294
mprobst marked an inline comment as done.
Comment at: lib/Format/TokenAnnotator.cpp:760
@@ +759,3 @@
+ if (CurrentToken->is(tok::kw_export)) {
+// Find the 'from' part of export {...} from '...';
+// The difference here is that "export {...};" should not be
mprobst updated this revision to Diff 51267.
mprobst marked an inline comment as done.
mprobst added a comment.
- Address review comments:
http://reviews.llvm.org/D17440
Files:
lib/Format/FormatToken.h
lib/Format/TokenAnnotator.cpp
unittests/Format/FormatTestJS.cpp
Index:
mprobst marked 3 inline comments as done.
mprobst added a comment.
http://reviews.llvm.org/D17440
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
mprobst updated this revision to Diff 51268.
mprobst added a comment.
Rebase diff on current master.
http://reviews.llvm.org/D17440
Files:
lib/Format/FormatToken.h
lib/Format/TokenAnnotator.cpp
unittests/Format/FormatTestJS.cpp
Index: unittests/Format/FormatTestJS.cpp
1 - 100 of 332 matches
Mail list logo