From: Sebastien Bourdeauducq Date: Sat, 10 Nov 2012 11:09:45 +0000 (+0100) Subject: Revert "pytholite/compiler: SymbolStack" X-Git-Tag: 24jan2021_ls180~2099^2~803 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a901ef46ab9137317670e9866c09e15baf0c282c;p=litex.git Revert "pytholite/compiler: SymbolStack" This reverts commit f57da497b2a96ab53de2fac37a34cdbc668c9636. --- diff --git a/migen/pytholite/compiler.py b/migen/pytholite/compiler.py index 28fe19be..14fb248b 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 = ""