printNode

abstract fun printNode(hint: EmitHint, node: Node, sourceFile: SourceFile): String(source)

Print a node and its subtree as-is, without any emit transformations.

Parameters

hint

A value indicating the purpose of a node. This is primarily used to distinguish between an Identifier used in an expression position, versus an Identifier used as an IdentifierName as part of a declaration. For most nodes you should just pass Unspecified.

node

The node to print. The node and its subtree are printed as-is, without any emit transformations.

sourceFile

A source file that provides context for the node. The source text of the file is used to emit the original source content for literals and identifiers, while the identifiers of the source file are used when generating unique names to avoid collisions.