mirror of
https://github.com/stevenrobertson/cuburn.git
synced 2025-02-05 11:40:04 -05:00
Allow use of 'prex' in precalc statements
This commit is contained in:
parent
5ab529bcde
commit
a97b53d4bd
@ -23,9 +23,10 @@ def var(num, name, code, params=None):
|
||||
|
||||
# TODO: This is a shitty hack
|
||||
def precalc(name, code):
|
||||
def precalc_fun(pv):
|
||||
def precalc_fun(pv, px=None):
|
||||
pre = pv._precalc()
|
||||
pre._code(Template(code, name+'_precalc').substitute(pre=pre))
|
||||
prex = px._precalc() if px is not None else None
|
||||
pre._code(Template(code, name+'_precalc').substitute(**locals()))
|
||||
Template.default_namespace[name+'_precalc'] = precalc_fun
|
||||
|
||||
# Variables note: all functions will have their weights as 'w',
|
||||
|
Loading…
Reference in New Issue
Block a user