evaluateAsync method
Evaluates the tag with proper scope management
Implementation
FutureOr<dynamic> evaluateAsync(Evaluator evaluator, Buffer buffer) async {
evaluator.context.pushScope();
final Map<String, dynamic> variables;
final dynamic result;
try {
final innerContext = evaluator.context.clone();
final innerEvaluator = Evaluator.withBuffer(innerContext, buffer)
..context.setRoot(evaluator.context.getRoot());
result = await evaluateWithContextAsync(innerEvaluator, buffer);
variables = innerContext.currentScopeVariables();
} finally {
evaluator.context.popScope();
}
evaluator.context.merge(variables);
return result;
}