MCPcopy Create free account
hub / github.com/angular/angular / RecursiveAstVisitor

Class RecursiveAstVisitor

packages/compiler/src/output/output_ast.ts:1732–1922  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1730}
1731
1732export class RecursiveAstVisitor implements StatementVisitor, ExpressionVisitor {
1733 visitType(ast: Type, context: any): any {
1734 return ast;
1735 }
1736 visitExpression(ast: Expression, context: any): any {
1737 if (ast.type) {
1738 ast.type.visitType(this, context);
1739 }
1740 return ast;
1741 }
1742 visitBuiltinType(type: BuiltinType, context: any): any {
1743 return this.visitType(type, context);
1744 }
1745 visitExpressionType(type: ExpressionType, context: any): any {
1746 type.value.visitExpression(this, context);
1747 if (type.typeParams !== null) {
1748 type.typeParams.forEach((param) => this.visitType(param, context));
1749 }
1750 return this.visitType(type, context);
1751 }
1752 visitArrayType(type: ArrayType, context: any): any {
1753 return this.visitType(type, context);
1754 }
1755 visitMapType(type: MapType, context: any): any {
1756 return this.visitType(type, context);
1757 }
1758 visitTransplantedType(type: TransplantedType<unknown>, context: any): any {
1759 return type;
1760 }
1761 visitWrappedNodeExpr(ast: WrappedNodeExpr<any>, context: any): any {
1762 return ast;
1763 }
1764 visitReadVarExpr(ast: ReadVarExpr, context: any): any {
1765 return this.visitExpression(ast, context);
1766 }
1767 visitDynamicImportExpr(ast: DynamicImportExpr, context: any) {
1768 return this.visitExpression(ast, context);
1769 }
1770 visitInvokeFunctionExpr(ast: InvokeFunctionExpr, context: any): any {
1771 ast.fn.visitExpression(this, context);
1772 this.visitAllExpressions(ast.args, context);
1773 return this.visitExpression(ast, context);
1774 }
1775 visitTaggedTemplateLiteralExpr(ast: TaggedTemplateLiteralExpr, context: any): any {
1776 ast.tag.visitExpression(this, context);
1777 ast.template.visitExpression(this, context);
1778 return this.visitExpression(ast, context);
1779 }
1780 visitInstantiateExpr(ast: InstantiateExpr, context: any): any {
1781 ast.classExpr.visitExpression(this, context);
1782 this.visitAllExpressions(ast.args, context);
1783 return this.visitExpression(ast, context);
1784 }
1785 visitLiteralExpr(ast: LiteralExpr, context: any): any {
1786 return this.visitExpression(ast, context);
1787 }
1788 visitRegularExpressionLiteral(ast: RegularExpressionLiteralExpr, context: any): any {
1789 return this.visitExpression(ast, context);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected