| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
| |
Without it, it would do:
interface I {
x: string;
} var y;
llvm-svn: 239593
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
statement.
When an exported function would follow a class declaration, it would not
be recognized as a stand-alone function. That would then collapse the
following line with the current one, e.g.
class C {}
export function f() {} var x;
llvm-svn: 239592
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
template <typename T>
auto aaaaaaaaaaaaaaaaaaaaaa(T t) -> decltype(eaaaaaaaaaaaaaaa<T>(t.a)
.aaaaaaaa());
After:
template <typename T>
auto aaaaaaaaaaaaaaaaaaaaaa(T t)
-> decltype(eaaaaaaaaaaaaaaa<T>(t.a).aaaaaaaa());
Also add a test case for a difficult template parsing case I stumbled accross.
Needs fixing.
llvm-svn: 239149
|
|
|
|
| |
llvm-svn: 238845
|
|
|
|
|
|
| |
No functional change intended.
llvm-svn: 238673
|
|
|
|
|
|
|
|
|
|
|
| |
Specifically adhere to LLVM Coding Standards (no 'else' after
return/break/continue) and remove yet another implementation of
paren counting. We already have enough of those in the
UnwrappedLineParser.
No functional changes intended.
llvm-svn: 238672
|
|
|
|
|
|
|
|
|
|
|
|
| |
Assigns a token type (TT_JsFatArrow) to => tokens, and uses that to
more easily recognize and format fat arrow functions.
Improves function parsing to better recognize formal parameter
lists and return type declarations.
Recognizes arrow functions and parse function bodies as child blocks.
Patch by Martin Probst.
llvm-svn: 237895
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
class C : test {
class D : test{void f(){int i{2};
}
}
;
}
;
After:
class C : test {
class D : test {
void f() { int i{2}; }
};
};
llvm-svn: 237569
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
class C : public D {
SomeClass SC { 2 };
};
After:
class C : public D {
SomeClass SC{2};
};
llvm-svn: 237568
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
specializations.
Before:
template <class T>
struct S < std::is_arithmetic<T> {
} > {};
After:
template <class T> struct S<std::is_arithmetic<T>{}> {};
llvm-svn: 237565
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It was fooled by the comment.
Before:
SOME_UNRELATED_MACRO
/*static*/ int i;
After:
SOME_UNRELATED_MACRO
/*static*/ int i;
llvm-svn: 237246
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
_asm {
} int i;
After:
_asm {
}
int i;
llvm-svn: 236985
|
|
|
|
|
|
| |
NFC intended.
llvm-svn: 236982
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
export function foo() {} export function bar() {}
After:
export function foo() {
}
export function bar() {
}
llvm-svn: 236978
|
|
|
|
|
|
|
|
| |
Some compilers ignore everything after a semicolon in such inline asm
blocks and thus, the closing brace must not be moved to the previous
line.
llvm-svn: 236946
|
|
|
|
|
|
|
|
|
|
|
| |
E.g.:
default:;
This can be used to get around restrictions as to what can follow a
label. It fixes llvm.org/PR19648.
llvm-svn: 236604
|
|
|
|
|
|
| |
This fixes llvm.org/PR23397.
llvm-svn: 236599
|
|
|
|
|
|
| |
We were already ignoring those already.
llvm-svn: 236591
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Optional methods use ? tokens like this:
interface X { y?(): z; }
It seems easiest to detect and disambiguate these from ternary
expressions by checking if the code is in a declaration context. Turns
out that that didn't quite work properly for interfaces in Java and JS,
and for JS file root contexts.
Patch by Martin Probst, thank you.
llvm-svn: 236488
|
|
|
|
| |
llvm-svn: 236415
|
|
|
|
| |
llvm-svn: 235702
|
|
|
|
|
|
| |
Patch by Martin Probst. Thank you.
llvm-svn: 234752
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
The patch is generated using clang-tidy misc-use-override check.
This command was used:
tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py \
-checks='-*,misc-use-override' -header-filter='llvm|clang' -j=32 -fix
Reviewers: dblaikie
Reviewed By: dblaikie
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D8926
llvm-svn: 234678
|
|
|
|
| |
llvm-svn: 234320
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes formatting unnamed bitfields (llvm.org/PR21999).
Before:
struct MyStruct {
uchar data;
uchar:
8;
uchar:
8;
uchar other;
};
After:
struct MyStruct {
uchar data;
uchar : 8;
uchar : 8;
uchar other;
};
llvm-svn: 234318
|
|
|
|
| |
llvm-svn: 233698
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
goog.scope(function() {
// test
var x = 0;
// test
});
After:
goog.scope(function() {
// test
var x = 0;
// test
});
llvm-svn: 233530
|
|
|
|
|
|
| |
NFC.
llvm-svn: 232975
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
A a = new A(){public String toString(){return "NotReallyA";
}
}
;
After:
A a = return new A() {
public String toString() {
return "NotReallyA";
}
};
This fixes llvm.org/PR22878.
llvm-svn: 232042
|
|
|
|
|
|
| |
Found by -Wmissing-prototypes.
llvm-svn: 231668
|
|
|
|
| |
llvm-svn: 230910
|
|
|
|
|
|
| |
Patch by Martin Probst, thank you!
llvm-svn: 229865
|
|
|
|
|
|
| |
Patch by Martin Probst.
llvm-svn: 229863
|
|
|
|
|
|
| |
Patch by Martin Probst. Thank you.
llvm-svn: 229862
|
|
|
|
|
|
|
|
|
|
| |
This adds support for JavaScript class definitions (again following
TypeScript & AtScript style). This only required support for
visibility modifiers in JS, everything else was already working.
Patch by Martin Probst, thank you.
llvm-svn: 229701
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This prevents contracting:
auto lambda = []() {
int a = 2
#if A
+ 2
#endif
;
};
into:
auto lambda = []() { int a = 2
#if A + 2
#endif ; };
Which is obviously BAD.
This fixes llvm.org/PR22496.
llvm-svn: 228522
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
@try {
// ...
}
@finally {
// ...
}
Now:
@try {
// ...
} @finally {
// ...
}
This is consistent with how we format C++ try blocks and SEH try blocks.
clang-format not doing this before was an implementation oversight.
This is dependent on BraceBreakingStyle. The snippet above is with the
Attach style. Style Stroustrip for example still results in the "Before:"
snippet, which makes sense since other blocks (try, else) break after '}' too.
llvm-svn: 228483
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This lets clang-format format
__try {
} __except(0) {
}
and
__try {
} __finally {
}
correctly. __try and __finally are keywords if `LangOpts.MicrosoftExt` is set,
so this turns this on. This also enables a few other keywords, but it
shouldn't overly perturb regular clang-format operation. __except is a
context-sensitive keyword, so `AdditionalKeywords` needs to be passed around to
a few more places.
Fixes PR22321.
llvm-svn: 228148
|
|
|
|
| |
llvm-svn: 226448
|
|
|
|
| |
llvm-svn: 226447
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
try
(SomeResource rs = someFunction()) {
Something();
}
After:
try (SomeResource rs = someFunction()) {
Something();
}
llvm-svn: 225973
|
|
|
|
|
|
|
|
|
| |
Specifically, adjust the leading "__asm {" and trailing "}" while still
leaving the assembly inside it alone.
This fixes llvm.org/PR22190.
llvm-svn: 225623
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
someFunction(new Runnable() { public void run() { System.out.println(42);
}
});
After:
someFunction(new Runnable() {
public void run() {
System.out.println(42);
}
});
llvm-svn: 225142
|
|
|
|
|
|
|
|
|
|
| |
Before:
auto next_pair = [](A * a) -> pair<A*, A*>{};
After:
auto next_pair = [](A* a) -> pair<A*, A*>{};
llvm-svn: 223652
|
|
|
|
|
|
| |
This fixes llvm.org/PR21756.
llvm-svn: 223458
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
SomeClass.
class.getName();
After:
SomeClass.class.getName();
This fixes llvm.org/PR21665.
llvm-svn: 222813
|
|
|
|
|
|
|
| |
These are like import statements and should not be line-wrapped. Minor
restructuring of the handling of other import statements.
llvm-svn: 222637
|
|
|
|
|
|
|
|
|
|
| |
Before:
auto a = [&b, c ](D * d) -> D * {}
After:
auto a = [&b, c](D* d) -> D* {}
llvm-svn: 222534
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
enum Foo implements Bar<X, Y> {
ABC {
...
}
, CDE {
...
};
}
After:
enum Foo implements Bar<X, Y> {
ABC {
...
},
CDE {
...
};
}
Patch by Harry Terkelsen.
llvm-svn: 222394
|
|
|
|
|
|
|
| |
In Java, enums can contain a class body and enum constants can have
arguments as well as class bodies. Support most of that.
llvm-svn: 221895
|