FunctionCallExpansionStage

Pipeline stage responsible for expanding function calls in the abstract syntax tree (AST).

This stage traverses the AST and expands any function calls found in the document.

Function calls are special constructs in the document that invoke functions defined in libraries. These functions can generate content, modify the document structure, or perform other operations.

This stage is crucial for implementing the extensibility of the document format, allowing users to define and use custom functions in their documents.

Properties

Link copied to clipboard
open override val hook: KProperty1<PipelineHooks, Pipeline.(AstRoot) -> Unit>

A hook function that is invoked after the stage completes processing.

Functions

Link copied to clipboard
open fun execute(input: AstRoot, data: SharedPipelineData): AstRoot

Executes this pipeline stage with the given input and shared data.

Link copied to clipboard

Utility function to execute a pipeline stage that takes Unit as input.

Link copied to clipboard
open fun invokeHook(data: SharedPipelineData, input: AstRoot, output: AstRoot)

Invokes the hook function for this stage, if one is defined.

Link copied to clipboard
open override fun peek(input: AstRoot, data: SharedPipelineData)

Peeks at the input without modifying it.

Link copied to clipboard
open override fun process(input: AstRoot, data: SharedPipelineData): AstRoot

Processes the input by calling peek and then returning the input unchanged.

Link copied to clipboard
infix fun <A, B, C> PipelineStage<A, B>.then(next: PipelineStage<B, C>): PipelineStage<A, C>

Chains two pipeline stages together to form a new pipeline stage.

Link copied to clipboard

Conditionally chains this pipeline stage with next if it is not null.