зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1332445 - Get rid of SymbolTable::globalScope. r=kanru
MozReview-Commit-ID: Ar69yiCqJnT --HG-- extra : rebase_source : 33a19aaf6f1586bd1c023cfe7637201ea6774301
This commit is contained in:
Родитель
d6a0e6b709
Коммит
a619072cc3
|
@ -490,13 +490,11 @@ class SymbolTable:
|
|||
def __init__(self, errors):
|
||||
self.errors = errors
|
||||
self.scopes = [ { } ] # stack({})
|
||||
self.globalScope = self.scopes[0]
|
||||
self.currentScope = self.globalScope
|
||||
self.currentScope = self.scopes[0]
|
||||
|
||||
def enterScope(self, node):
|
||||
assert (isinstance(self.scopes[0], dict)
|
||||
and self.globalScope is self.scopes[0])
|
||||
assert (isinstance(self.currentScope, dict))
|
||||
assert isinstance(self.scopes[0], dict)
|
||||
assert isinstance(self.currentScope, dict)
|
||||
|
||||
if not hasattr(node, 'symtab'):
|
||||
node.symtab = { }
|
||||
|
@ -510,8 +508,7 @@ class SymbolTable:
|
|||
|
||||
self.currentScope = self.scopes[-1]
|
||||
|
||||
assert (isinstance(self.scopes[0], dict)
|
||||
and self.globalScope is self.scopes[0])
|
||||
assert isinstance(self.scopes[0], dict)
|
||||
assert isinstance(self.currentScope, dict)
|
||||
|
||||
def lookup(self, sym):
|
||||
|
|
Загрузка…
Ссылка в новой задаче