From a901ef46ab9137317670e9866c09e15baf0c282c Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Sat, 10 Nov 2012 12:09:45 +0100 Subject: [PATCH] Revert "pytholite/compiler: SymbolStack" This reverts commit f57da497b2a96ab53de2fac37a34cdbc668c9636. --- migen/pytholite/compiler.py | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/migen/pytholite/compiler.py b/migen/pytholite/compiler.py index 28fe19be5..14fb248b5 100644 --- a/migen/pytholite/compiler.py +++ b/migen/pytholite/compiler.py @@ -55,35 +55,13 @@ class _Register: sync = [Case(self.sel, *cases)] return Fragment(sync=sync) -class _SymbolStack: - def __init__(self): - self.stack = [] - - def push(self, init={}): - self.stack.append(init) - - def pop(self): - return self.stack.pop() - - def __setitem__(self, key, value): - self.stack[-1][key] = value - - def __getitem__(self, key): - for frame in reversed(self.stack): - try: - return frame[key] - except KeyError: - pass - raise KeyError - class _AbstractNextState: def __init__(self, target_state): self.target_state = target_state class _Compiler: def __init__(self, symdict, registers): - self.symdict = _SymbolStack() - self.symdict.push(symdict) + self.symdict = symdict self.registers = registers self.targetname = ""