mirror of
https://github.com/stevenrobertson/cuburn.git
synced 2025-02-05 11:40:04 -05:00
Allow register local name rebinding
This commit is contained in:
parent
e03f20392d
commit
db72a7d496
@ -333,8 +333,9 @@ class _CallChain(object):
|
|||||||
self.__chain = []
|
self.__chain = []
|
||||||
def __call__(self, *args, **kwargs):
|
def __call__(self, *args, **kwargs):
|
||||||
assert(self.__chain)
|
assert(self.__chain)
|
||||||
self._call(self.__chain, *args, **kwargs)
|
r = self._call(self.__chain, *args, **kwargs)
|
||||||
self.__chain = []
|
self.__chain = []
|
||||||
|
return r
|
||||||
def __getattr__(self, name):
|
def __getattr__(self, name):
|
||||||
if name == 'global_':
|
if name == 'global_':
|
||||||
name = 'global'
|
name = 'global'
|
||||||
@ -371,6 +372,9 @@ class _RegFactory(_CallChain):
|
|||||||
regs = map(lambda n: Reg(type, n), names)
|
regs = map(lambda n: Reg(type, n), names)
|
||||||
self.block.code(op='.reg .' + type, vars=_softjoin(names, ','))
|
self.block.code(op='.reg .' + type, vars=_softjoin(names, ','))
|
||||||
[self.block.inject(r.name, r) for r in regs]
|
[self.block.inject(r.name, r) for r in regs]
|
||||||
|
if len(regs) == 1:
|
||||||
|
return regs[0]
|
||||||
|
return regs
|
||||||
|
|
||||||
class Op(_CallChain):
|
class Op(_CallChain):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user