style(compiler): reformat of codebase with new clang-format version (#36520)

This commit reformats the packages/compiler tree using the new version of
clang-format.

PR Close #36520
This commit is contained in:
Alex Rickabaugh
2020-04-08 10:14:18 -07:00
committed by atscott
parent d5aa6b5bd6
commit cbed582a1a
193 changed files with 5904 additions and 4574 deletions

View File

@ -26,23 +26,35 @@
export class AstPath<T> {
constructor(private path: T[], public position: number = -1) {}
get empty(): boolean { return !this.path || !this.path.length; }
get head(): T|undefined { return this.path[0]; }
get tail(): T|undefined { return this.path[this.path.length - 1]; }
get empty(): boolean {
return !this.path || !this.path.length;
}
get head(): T|undefined {
return this.path[0];
}
get tail(): T|undefined {
return this.path[this.path.length - 1];
}
parentOf(node: T|undefined): T|undefined {
return node && this.path[this.path.indexOf(node) - 1];
}
childOf(node: T): T|undefined { return this.path[this.path.indexOf(node) + 1]; }
childOf(node: T): T|undefined {
return this.path[this.path.indexOf(node) + 1];
}
first<N extends T>(ctor: {new (...args: any[]): N}): N|undefined {
first<N extends T>(ctor: {new(...args: any[]): N}): N|undefined {
for (let i = this.path.length - 1; i >= 0; i--) {
let item = this.path[i];
if (item instanceof ctor) return <N>item;
}
}
push(node: T) { this.path.push(node); }
push(node: T) {
this.path.push(node);
}
pop(): T { return this.path.pop() !; }
pop(): T {
return this.path.pop()!;
}
}