예제 #1
0
        public object visitExprVarExpr(ExprVar expr)
        {
            bool x;

            if (scopes.Count > 0 && scopes.Peek().TryGetValue(expr.name.lexeme, out x) && !x)
            {
                Program.error(expr.name, "Cannot read local variable in its own initializer.");
            }
            resolveLocal(expr, expr.name);
            return(null);
        }
예제 #2
0
 public object visitExprVarExpr(ExprVar expr)
 {
     return(lookUpVariable(expr.name, expr));
 }
예제 #3
0
 public object visitExprVarExpr(ExprVar expr)
 {
     return(expr.name);
 }