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 thesumcall (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 5The previous example contains a body composed of multiple expressions:
StringValue(Item 1);FunctionCall(foreach)which returns anIterableValueof 3 elements;StringValue(Item 5). After appending these values, the resulting expression is anIterableValue(a GeneralCollectionValue in particular) which contains:Item 1,Item 2,Item 3,Item 4,Item 5.
Parameters
expression to append to the visited expression