示例#1
0
def execute_expr(variable: Variable, env: Environment):
    return env.get(variable.var.lexeme, variable.depth)
示例#2
0
def execute_expr(this: This, env: Environment):
    return env.get("this", this.depth)
示例#3
0
def execute_expr(lox_super: Super, env: Environment):
    superclass = env.get("super", lox_super.depth)
    this = env.get("this", lox_super.depth - 1)
    return superclass.getMethod(lox_super.method).bind(this)