def __init__(self, parent, arg_names=[]): super(FunctionContext, self).__init__(parent) if parent: self.scope = Scope(self.scope) self.arg_names = arg_names for arg_name in self.arg_names: self.scope.declare(arg_name, False)
def __init__(self, parent): if parent: self.indent = parent.indent self.scope = parent.scope else: self.indent = 0 self.scope = Scope() self.body = []
def __init__(self, parent, name): super(ClassContext, self).__init__(parent) self.scope = Scope(self.scope) self.scope.prefix = parent.scope.prefix + [name, 'prototype'] self.scope.inherited = False
def setUp(self): self.p1 = Scope() self.p2 = Scope(self.p1) self.p2.inherited = False self.s = Scope(self.p2)
def setUp(self): self.p = Scope() self.s = Scope(self.p)
def setUp(self): self.s = Scope()