AppendExpressionVisitor

An ExpressionVisitor that describes the way two expressions are joined together.

For example, in the Quarkdown source: .somefunction {three plus two is .sum {3} {2}} The argument to somefunction is a ComposedExpression built by these sub-expressions:

  • StringValue(three plus two is )

  • FunctionCall(sum, 3, 2) After the evaluation of the sum call (handled by EvalExpressionVisitor) has been executed, the output values are:

  • StringValue(three plus two is )

  • NumberValue(5) These two values are then joined together by this AppendExpressionVisitor, producing: StringValue(three plus two is 5)

The same principle applies to 'block expressions':

.if {...}
Item 1
.foreach {2..4}
n:
Item .n
Item 5

The previous example contains a body composed of multiple expressions:

  • StringValue(Item 1);

  • FunctionCall(foreach) which returns an IterableValue of 3 elements;

  • StringValue(Item 5). After appending these values, the resulting expression is an IterableValue (a GeneralCollectionValue in particular) which contains: Item 1, Item 2, Item 3, Item 4, Item 5.

Parameters

other

expression to append to the visited expression

See also

Constructors

Link copied to clipboard
constructor(other: Expression)

Functions

Link copied to clipboard
open override fun visit(expression: FunctionCall<*>): Expression
open override fun visit(expression: ComposedExpression): Expression
open override fun visit(value: BooleanValue): Expression
open override fun visit(value: DictionaryValue<*>): InputValue<*>
open override fun visit(value: DynamicValue): Expression
open override fun visit(value: EnumValue): InputValue<*>
open override fun visit(value: GeneralCollectionValue<*>): GeneralCollectionValue<*>
open override fun visit(value: InlineMarkdownContentValue): Expression
open override fun visit(value: LambdaValue): Expression
open override fun visit(value: MarkdownContentValue): Expression
open override fun visit(value: NodeValue): Expression
open override fun visit(value: NoneValue): InputValue<*>
open override fun visit(value: NumberValue): InputValue<*>
open override fun visit(value: ObjectValue<*>): InputValue<*>
open override fun visit(value: OrderedCollectionValue<*>): Expression
open override fun visit(value: PairValue<*, *>): Expression
open override fun visit(value: StringValue): InputValue<*>
open override fun visit(value: UnorderedCollectionValue<*>): Expression