pivot method
Object?
pivot(
- DataInstance? model,
- EvaluationContext context,
- List<
Object> pivots, - Object sentinel,
override
. or the node itself is the sentinel; paths with predicates can't
be pivoted; other paths evaluate normally.
Implementation
@override
Object? pivot(
DataInstance? model,
EvaluationContext context,
List<Object> pivots,
Object sentinel,
) {
final ref = _reference;
if (ref == sentinel || ref.refLevel == 0) return sentinel;
for (var i = 0; i < ref.size; i++) {
final predicates = ref.predicatesAt(i);
if (predicates != null && predicates.isNotEmpty) {
throw UnpivotableExpressionException(
"Can't pivot filtered treereferences. Ref: "
'${ref.toString(includePredicates: true)} has predicates.',
);
}
}
return eval(model, context);
}