Returns the bound expression for the given variable.
Performs recursive lookup through parentScope
.
Throws a StateError
, if variable is still unbound at the root scope.
Source
Expression getExpression(String varName) {
if (variables.containsKey(varName)) {
return variables[varName];
} else if (parentScope != null) {
return parentScope.getExpression(varName);
} else {
throw new StateError('Variable not bound: $varName');
}
}