visitVariableExpr method

  1. @override
void visitVariableExpr(
  1. Variable expr
)
override

Implementation

@override
void visitVariableExpr(Expr.Variable expr) {
  if (!scopes.isEmpty && scopes.peek()[expr.name.lexeme] == false) {
    error1(expr.name, 'Can not read local variable in its own initializer.');
  }
  resolveLocal(expr, expr.name);
  return;
}