back.pysim: implement ArrayProxy.

This commit is contained in:
whitequark 2018-12-15 19:37:36 +00:00
parent 80c5343600
commit 54fb999c99
4 changed files with 39 additions and 2 deletions

View file

@ -148,6 +148,12 @@ class _RHSValueCompiler(ValueTransformer):
return normalize(result, shape)
return eval
def on_ArrayProxy(self, value):
shape = value.shape()
elems = list(map(self, value.elems))
index = self(value.index)
return lambda state: normalize(elems[index(state)](state), shape)
class _StatementCompiler(StatementTransformer):
def __init__(self):