withActiveVisitor<T> static method
Execute fn with the given visitor as the active visitor.
Restores the previous visitor when done (supports nesting).
Implementation
static T withActiveVisitor<T>(InterpreterVisitor visitor, T Function() fn) {
final previous = _activeVisitor;
_activeVisitor = visitor;
try {
return fn();
} finally {
_activeVisitor = previous;
}
}