Exemplo n.º 1
0
        public object visitVariableExpr(Expr.Variable expr)
        {
            if (scopes.Any() && scopes.Peek()[expr.name.lexeme] == false)
            {
                errorFunc(expr.name, "Cannot read local variable in its own initializer.");
            }

            resolveLocal(expr, expr.name);
            return(null);
        }
Exemplo n.º 2
0
 public object visitVariableExpr(Expr.Variable expr)
 {
     return(lookupVariable(expr.name, expr));
 }