FunctionCallNode

class FunctionCallNode(val context: Context, val name: String, val arguments: List<FunctionCallArgument>, val isBlock: Boolean, val delegator: Node? = null, val sourceText: CharSequence? = null, val sourceRange: IntRange? = null) : NestableNode, ErrorCapableNode

A call to a function. The call is executed after parsing, and its output is stored in its mutable children.

Parameters

context

context this node lies in, which is where symbols will be loaded from upon execution

name

name of the function to call

arguments

arguments to call the function with

isBlock

whether this function call is an isolated block (opposite: inline)

delegator

if this call was synthesized at parse time from a primitive Markdown node (see com.quarkdown.core.ast.attributes.primitive.PrimitiveFunctionBackedNode), the original node. When set, the expander falls back to rendering this node directly if no .extend has been registered for name, skipping function dispatch overhead

sourceText

if available, the source code of the whole function call

sourceRange

if available, the range of the function call in the source code

Constructors

Link copied to clipboard
constructor(context: Context, name: String, arguments: List<FunctionCallArgument>, isBlock: Boolean, delegator: Node? = null, sourceText: CharSequence? = null, sourceRange: IntRange? = null)

Properties

Link copied to clipboard
Link copied to clipboard
open override val children: MutableList<Node>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The error that occurred during processing, paired with the PipelineErrorHandler strategy to handle it. If null, no error occurred and the node is rendered normally via acceptOnSuccess.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
open fun <T> accept(visitor: NodeVisitor<T>): T

Accepts a visitor.

Link copied to clipboard
open override fun <T> acceptOnSuccess(visitor: NodeVisitor<T>): T

Visits this node with the given visitor when no error is present.

Link copied to clipboard

Returns a sequence of all nodes in the tree, where this is the root node. The sequence is generated by traversing the tree in depth-first order. The root node is excluded from the sequence.

Link copied to clipboard

Retrieves the stored media associated with this node, if any.

Link copied to clipboard
fun ErrorCapableNode.setError(throwable: Throwable, context: Context)

Sets the given throwable as the error of this node, paired with the error handler from context.

Link copied to clipboard
fun Node.withChildren(newChildren: List<Node>): Node

Returns a copy of this node with its children replaced by newChildren.

Link copied to clipboard