Skip to content
Snippets Groups Projects
Commit 6cccc53a9ebe authored by Sylvain Thenault's avatar Sylvain Thenault
Browse files

deal with substitution constant in unsimplification

parent 06e9d7f2b790
No related branches found
No related tags found
No related merge requests found
......@@ -349,4 +349,7 @@
restriction = []
if unsimplified and self.stinfo['rewritten']:
vvalues = {}
# hact to avoid actually replacing introduced const node:
# replace const value by variable value and set constant type to Int
# to avoid quoting
for vname, consts in self.stinfo['rewritten'].iteritems():
......@@ -352,5 +355,6 @@
for vname, consts in self.stinfo['rewritten'].iteritems():
vvalues[vname] = consts[0].value
restriction.append('%s eid %s' % (vname, consts[0].value))
eid = consts[0].eval(kwargs)
vvalues[vname] = (consts[0].type, eid)
restriction.append('%s eid %s' % (vname, eid))
for const in consts:
const.value = vname
......@@ -355,5 +359,6 @@
for const in consts:
const.value = vname
const.type = 'Int'
s = [','.join(as_string(term) for term in self.selection)]
if self.groupby:
s.append('GROUPBY ' + ','.join(as_string(term)
......@@ -377,7 +382,7 @@
if unsimplified and self.stinfo['rewritten']:
for vname, consts in self.stinfo['rewritten'].iteritems():
for const in consts:
const.value = vvalues[vname]
const.type, const.value = vvalues[vname]
return 'Any ' + ' '.join(s)
def copy(self, copy_solutions=True, solutions=None):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment