| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
void f() {
label:
signals
.baz();
}
After:
void f() {
label:
signals.baz();
}
llvm-svn: 276854
|
|
|
|
| |
llvm-svn: 273196
|
|
|
|
| |
llvm-svn: 273179
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: ASI did not handle the ES6 `as` operator correctly.
Reviewers: djasper
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D20817
llvm-svn: 271401
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Only treat the sequence `async function` as the start of a function expression,
as opposed to every occurrence of the token `async` (whoops).
Reviewers: djasper
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D20737
llvm-svn: 271184
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
#define MACRO(a) \
if (a) { \
f(); \
} else \
g()
After:
#define MACRO(a) \
if (a) { \
f(); \
} else \
g()
llvm-svn: 270028
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
template <enum E> class A { public : E *f(); };
After:
template <enum E> class A {
public:
E *f();
};
llvm-svn: 268878
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For generators, see:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_generators
async functions are not quite in the spec yet, but stage 3 and already widely used:
http://tc39.github.io/ecmascript-asyncawait/
Reviewers: djasper
Subscribers: klimek
Differential Revision: http://reviews.llvm.org/D19204
llvm-svn: 267368
|
|
|
|
| |
llvm-svn: 266790
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
`interface` can be used as a fee standing identifier in JavaScript/TypeScript.
This change uses the heuristic of whether it's followed by another identifier
as an indication.
Reviewers: djasper
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D19240
llvm-svn: 266789
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Change `import` and `export` parsing to special case the renaming
syntax (`import x, {y as bar} ...`, `export {x}`) and otherwise just
parse a regular structural element.
This simplifies the code a bit and should be more correct - it's easier
to recognise the specific import syntax than to recognise arbitrary
expressions and declarations.
Reviewers: djasper
Subscribers: cfe-commits, klimek
Differential Revision: http://reviews.llvm.org/D19242
llvm-svn: 266743
|
|
|
|
|
|
|
|
|
|
| |
Indentation of the last line was reset to the initial indentation of the block when reaching EOF.
Patch by Maxime Beaulieu
Differential Revision: http://reviews.llvm.org/D19065
llvm-svn: 266321
|
|
|
|
|
|
|
|
| |
This should've been forwards from rbegin(), reverse iterators are just
too confusing to be used by mere mortals. Fixes out-of-bounds walks over
the list.
llvm-svn: 265934
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: djasper
Subscribers: klimek
Differential Revision: http://reviews.llvm.org/D18943
llvm-svn: 265916
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
#define A \
if (a) \
label: \
f()
After:
#define A \
if (a) \
label: \
f()
llvm-svn: 265557
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
While I am not personally convinced about the usefulness of this
construct, we should break it.
Before:
if (a) label:
f();
After:
if (a)
label:
f();
llvm-svn: 265545
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Automatic Semicolon Insertion can only be properly handled by parsing
source code. However conservatively catching just a few, common
situations prevents breaking code during development, which greatly
improves usability.
JS code should still use semicolons, and ASI code should be flagged by
a compiler or linter.
Patch by Martin Probst. Thank you.
llvm-svn: 263470
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
for (let { a, b } of x) {
}
After:
for (let {a, b} of x) {
}
llvm-svn: 262776
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
enum?: string
[];
After:
enum?: string[];
llvm-svn: 259628
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
export abstract class X {y: number;}
(and all sorts of other havoc in more complicated cases).
After:
export abstract class X { y: number; }
llvm-svn: 257451
|
|
|
|
| |
llvm-svn: 257406
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
var x: {
a: string;
b: number;
}
= {};
After:
var x: {a: string; b: number;} = {};
llvm-svn: 257255
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
foo = class {
constructor() {}
}
;
After:
foo = class {
constructor() {}
};
llvm-svn: 257154
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
import a, {X, Y}
from 'some/module.js';
After:
import a, {X, Y} from 'some/module.js';
llvm-svn: 257038
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
enum: string
[];
After:
enum: string[];
llvm-svn: 256546
|
|
|
|
| |
llvm-svn: 256412
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
interface I {
o: {}
[];
}
After:
interface I {
o: {}[];
}
llvm-svn: 256247
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
void f() { struct Dummy { };
f();
}
After:
void f() {
struct Dummy {};
f();
}
llvm-svn: 256175
|
|
|
|
|
|
| |
Patch by Alexander Richardson, thank you!
llvm-svn: 254407
|
|
|
|
|
|
|
|
| |
Correct handling for C++17 inline namespaces. We would previously fail to
identify the inline namespaces as a namespace name since multiple ones may be
concatenated now with C++17.
llvm-svn: 251690
|
|
|
|
|
|
|
|
|
|
| |
Summary: It breaks the build for the ASTMatchers
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D13893
llvm-svn: 250827
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Replace empty bodies of default constructors and destructors with '= default'.
Reviewers: bkramer, klimek
Subscribers: klimek, alexfh, cfe-commits
Differential Revision: http://reviews.llvm.org/D13890
llvm-svn: 250822
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
inline A operator^(const A &lhs, const A &rhs) {} int i;
After:
inline A operator^(const A &lhs, const A &rhs) {}
int i;
llvm-svn: 249517
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
control the individual braces. The existing choices for brace wrapping
are now merely presets for the different flags that get expanded upon
calling the reformat function.
All presets have been chose to keep the existing formatting, so there
shouldn't be any difference in formatting behavior.
Also change the dump_format_style.py to properly document the nested
structs that are used to keep these flags discoverable among all the
configuration flags.
llvm-svn: 248802
|
|
|
|
|
|
|
|
|
| |
JavaScript allows keywords to appear in IdenfierName positions, e.g.
fields, or object literal members, but not as plain identifiers.
Patch by Martin Probst. Thank you!
llvm-svn: 248714
|
|
|
|
|
|
| |
Patch by Martin Probst. Thank you!
llvm-svn: 248713
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before:
#define A \
{ a, a } \
,
After:
#define A {a, a},
llvm-svn: 245837
|
|
|
|
|
|
|
|
|
|
| |
Before:
[ a, a ]() -> a<1>{};
After:
[a, a]() -> a<1> {};
llvm-svn: 244890
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In proto, enum constants can contain complex options and should be
handled more like individual declarations.
Before:
enum Type {
UNKNOWN = 0 [(some_options) =
{
a: aa,
b: bb
}];
};
After:
enum Type {
UNKNOWN = 0 [(some_options) = {
a: aa,
b: bb
}];
};
llvm-svn: 242404
|
|
|
|
|
|
| |
Differential Revision: http://reviews.llvm.org/D10883
llvm-svn: 241986
|
|
|
|
| |
llvm-svn: 241446
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The MacroBlockBegin and MacroBlockEnd options make matching macro identifiers
behave like '{' and '}', respectively, in terms of indentation.
Mozilla code, for example, uses several macros that begin and end a scope.
Previously, Clang-Format removed the indentation resulting in:
MACRO_BEGIN(...)
MACRO_ENTRY(...)
MACRO_ENTRY(...)
MACRO_END
Now, using the options
MacroBlockBegin: "^[A-Z_]+_BEGIN$"
MacroBlockEnd: "^[A-Z_]+_END$"
will yield the expected result:
MACRO_BEGIN(...)
MACRO_ENTRY(...)
MACRO_ENTRY(...)
MACRO_END
Differential Revision: http://reviews.llvm.org/D10840
llvm-svn: 241363
|
|
|
|
|
|
|
|
|
|
|
| |
Among other things, this makes clang-format understand arbitrary blocks
embedded in them, such as:
SomeFunction({MACRO({ return output; }), b});
where MACRO could e.g. expand to a lambda.
llvm-svn: 241059
|
|
|
|
|
|
|
|
|
|
| |
Format @autoreleasepool properly for the Attach brace style
by recognizing @autoreleasepool as a block introducer.
Patch from Strager Neds!
http://reviews.llvm.org/D10372
llvm-svn: 240896
|
|
|
|
|
|
|
| |
The previous one (r240021) regressed:
enum E Type::f() { .. }
llvm-svn: 240127
|
|
|
|
|
|
|
|
|
| |
Before, this wasn't formatted properly:
enum ::C f() {
return a;
}
llvm-svn: 240021
|
|
|
|
| |
llvm-svn: 239903
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Patch by Martin Probst.
Before:
enum {
A,
B
} var x = 1;
After:
enum {
A,
B
}
var x = 1;
llvm-svn: 239893
|
|
|
|
| |
llvm-svn: 239595
|
|
|
|
|
|
|
|
|
|
| |
Without it, it would do:
interface I {
x: string;
} var y;
llvm-svn: 239593
|