| 1718 | } |
| 1719 | |
| 1720 | export class RecursiveAstVisitor implements StatementVisitor, ExpressionVisitor { |
| 1721 | visitType(ast: Type, context: any): any { |
| 1722 | return ast; |
| 1723 | } |
| 1724 | visitExpression(ast: Expression, context: any): any { |
| 1725 | if (ast.type) { |
| 1726 | ast.type.visitType(this, context); |
| 1727 | } |
| 1728 | return ast; |
| 1729 | } |
| 1730 | visitBuiltinType(type: BuiltinType, context: any): any { |
| 1731 | return this.visitType(type, context); |
| 1732 | } |
| 1733 | visitExpressionType(type: ExpressionType, context: any): any { |
| 1734 | type.value.visitExpression(this, context); |
| 1735 | if (type.typeParams !== null) { |
| 1736 | type.typeParams.forEach((param) => this.visitType(param, context)); |
| 1737 | } |
| 1738 | return this.visitType(type, context); |
| 1739 | } |
| 1740 | visitArrayType(type: ArrayType, context: any): any { |
| 1741 | return this.visitType(type, context); |
| 1742 | } |
| 1743 | visitMapType(type: MapType, context: any): any { |
| 1744 | return this.visitType(type, context); |
| 1745 | } |
| 1746 | visitTransplantedType(type: TransplantedType<unknown>, context: any): any { |
| 1747 | return type; |
| 1748 | } |
| 1749 | visitWrappedNodeExpr(ast: WrappedNodeExpr<any>, context: any): any { |
| 1750 | return ast; |
| 1751 | } |
| 1752 | visitReadVarExpr(ast: ReadVarExpr, context: any): any { |
| 1753 | return this.visitExpression(ast, context); |
| 1754 | } |
| 1755 | visitDynamicImportExpr(ast: DynamicImportExpr, context: any) { |
| 1756 | return this.visitExpression(ast, context); |
| 1757 | } |
| 1758 | visitInvokeFunctionExpr(ast: InvokeFunctionExpr, context: any): any { |
| 1759 | ast.fn.visitExpression(this, context); |
| 1760 | this.visitAllExpressions(ast.args, context); |
| 1761 | return this.visitExpression(ast, context); |
| 1762 | } |
| 1763 | visitTaggedTemplateLiteralExpr(ast: TaggedTemplateLiteralExpr, context: any): any { |
| 1764 | ast.tag.visitExpression(this, context); |
| 1765 | ast.template.visitExpression(this, context); |
| 1766 | return this.visitExpression(ast, context); |
| 1767 | } |
| 1768 | visitInstantiateExpr(ast: InstantiateExpr, context: any): any { |
| 1769 | ast.classExpr.visitExpression(this, context); |
| 1770 | this.visitAllExpressions(ast.args, context); |
| 1771 | return this.visitExpression(ast, context); |
| 1772 | } |
| 1773 | visitLiteralExpr(ast: LiteralExpr, context: any): any { |
| 1774 | return this.visitExpression(ast, context); |
| 1775 | } |
| 1776 | visitRegularExpressionLiteral(ast: RegularExpressionLiteralExpr, context: any): any { |
| 1777 | return this.visitExpression(ast, context); |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…