TransformationContext

Properties

Link copied to clipboard
abstract val factory: NodeFactory
Link copied to clipboard
abstract var onEmitNode: (hint: EmitHint, node: Node, emitCallback: (hint: EmitHint, node: Node) -> Unit) -> Unit

Hook used to allow transformers to capture state before or after the printer emits a node.

Link copied to clipboard
abstract var onSubstituteNode: (hint: EmitHint, node: Node) -> Node

Hook used by transformers to substitute expressions just before they are emitted by the pretty printer.

Functions

Link copied to clipboard

Enables before/after emit notifications in the pretty printer for the provided SyntaxKind.

Link copied to clipboard
abstract fun enableSubstitution(kind: SyntaxKind)

Enables expression substitutions in the pretty printer for the provided SyntaxKind.

Link copied to clipboard

Ends a lexical environment, returning any declarations.

Link copied to clipboard

Gets the compiler options supplied to the transformer.

Link copied to clipboard

Hoists a function declaration to the containing scope.

Link copied to clipboard

Hoists a variable declaration to the containing scope.

Link copied to clipboard

Determines whether before/after emit notifications should be raised in the pretty printer when it emits a node.

Link copied to clipboard
abstract fun isSubstitutionEnabled(node: Node): Boolean

Determines whether expression substitutions are enabled for the provided node.

Link copied to clipboard

Gets and resets the requested non-scoped emit helpers.

Link copied to clipboard
abstract fun requestEmitHelper(helper: EmitHelper)

Records a request for a non-scoped emit helper in the current context.

Link copied to clipboard

Resumes a suspended lexical environment, usually before visiting a function body.

Link copied to clipboard

Starts a new lexical environment.

Link copied to clipboard

Suspends the current lexical environment, usually after visiting a parameter list.