Skip to content
Snippets Groups Projects
Commit 60255eecf96c authored by Sylvain Thénault's avatar Sylvain Thénault
Browse files

cleanup rql simplification code

parent 7f40b201b020
No related branches found
No related tags found
No related merge requests found
......@@ -136,7 +136,5 @@
var = uidrel.children[0].variable
vconsts = []
rhs = uidrel.children[1].children[0]
#from rql.nodes import Constant
#assert isinstance(rhs, nodes.Constant), rhs
for vref in var.references():
rel = vref.relation()
......@@ -141,6 +139,5 @@
for vref in var.references():
rel = vref.relation()
#assert vref.parent
if rel is None:
term = vref
while not term.parent is select:
......@@ -162,9 +159,6 @@
rhs = copy_uid_node(select, rhs, vconsts)
select.groupby[select.groupby.index(vref)] = rhs
rhs.parent = select
elif rel is uidrel:
# drop this relation
rel.parent.remove(rel)
elif rel.is_types_restriction():
stinfo['typerel'] = None
rel.parent.remove(rel)
......@@ -172,6 +166,7 @@
rhs = copy_uid_node(select, rhs, vconsts)
vref.parent.replace(vref, rhs)
del select.defined_vars[var.name]
uidrel.parent.remove(uidrel)
stinfo['uidrel'] = None
rewritten = True
if vconsts:
......
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