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:
@ -12,9 +12,9 @@ import {DEFAULT_INTERPOLATION_CONFIG, InterpolationConfig} from '../../../src/ml
|
||||
class Unparser implements AstVisitor {
|
||||
private static _quoteRegExp = /"/g;
|
||||
// TODO(issue/24571): remove '!'.
|
||||
private _expression !: string;
|
||||
private _expression!: string;
|
||||
// TODO(issue/24571): remove '!'.
|
||||
private _interpolationConfig !: InterpolationConfig;
|
||||
private _interpolationConfig!: InterpolationConfig;
|
||||
|
||||
unparse(ast: AST, interpolationConfig: InterpolationConfig) {
|
||||
this._expression = '';
|
||||
@ -69,7 +69,7 @@ class Unparser implements AstVisitor {
|
||||
}
|
||||
|
||||
visitFunctionCall(ast: FunctionCall, context: any) {
|
||||
this._visit(ast.target !);
|
||||
this._visit(ast.target!);
|
||||
this._expression += '(';
|
||||
let isFirst = true;
|
||||
ast.args.forEach(arg => {
|
||||
@ -137,7 +137,7 @@ class Unparser implements AstVisitor {
|
||||
|
||||
visitLiteralPrimitive(ast: LiteralPrimitive, context: any) {
|
||||
if (typeof ast.value === 'string') {
|
||||
this._expression += `"${ast.value.replace( Unparser._quoteRegExp, '\"')}"`;
|
||||
this._expression += `"${ast.value.replace(Unparser._quoteRegExp, '\"')}"`;
|
||||
} else {
|
||||
this._expression += `${ast.value}`;
|
||||
}
|
||||
@ -186,7 +186,9 @@ class Unparser implements AstVisitor {
|
||||
this._expression += `${ast.prefix}:${ast.uninterpretedExpression}`;
|
||||
}
|
||||
|
||||
private _visit(ast: AST) { ast.visit(this); }
|
||||
private _visit(ast: AST) {
|
||||
ast.visit(this);
|
||||
}
|
||||
}
|
||||
|
||||
const sharedUnparser = new Unparser();
|
||||
|
@ -22,8 +22,8 @@ class ASTValidator extends RecursiveAstVisitor {
|
||||
if (!inSpan(ast.span, this.parentSpan)) {
|
||||
if (this.parentSpan) {
|
||||
const parentSpan = this.parentSpan as ParseSpan;
|
||||
throw Error(
|
||||
`Invalid AST span [expected (${ast.span.start}, ${ast.span.end}) to be in (${parentSpan.start}, ${parentSpan.end}) for ${unparse(ast)}`);
|
||||
throw Error(`Invalid AST span [expected (${ast.span.start}, ${ast.span.end}) to be in (${
|
||||
parentSpan.start}, ${parentSpan.end}) for ${unparse(ast)}`);
|
||||
} else {
|
||||
throw Error(`Invalid root AST span for ${unparse(ast)}`);
|
||||
}
|
||||
@ -111,7 +111,7 @@ class ASTValidator extends RecursiveAstVisitor {
|
||||
}
|
||||
}
|
||||
|
||||
function inSpan(span: ParseSpan, parentSpan: ParseSpan | undefined): parentSpan is ParseSpan {
|
||||
function inSpan(span: ParseSpan, parentSpan: ParseSpan|undefined): parentSpan is ParseSpan {
|
||||
return !parentSpan || (span.start >= parentSpan.start && span.end <= parentSpan.end);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user