1 """Functions to add additional annotations on a rql syntax tree to ease later |
1 """Functions to add additional annotations on a rql syntax tree to ease later |
2 code generation. |
2 code generation. |
3 |
3 |
4 :organization: Logilab |
4 :organization: Logilab |
5 :copyright: 2001-2008 LOGILAB S.A. (Paris, FRANCE), all rights reserved. |
5 :copyright: 2001-2009 LOGILAB S.A. (Paris, FRANCE), all rights reserved. |
6 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr |
6 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr |
7 """ |
7 """ |
8 __docformat__ = "restructuredtext en" |
8 __docformat__ = "restructuredtext en" |
9 |
9 |
10 from logilab.common.compat import any |
10 from logilab.common.compat import any |
11 |
11 |
12 from rql.nodes import Relation, Exists, VariableRef, Constant, Variable, Or |
12 from rql.nodes import Relation, VariableRef, Constant, Variable, Or |
13 from rql.utils import common_parent |
13 from rql.utils import common_parent |
14 |
|
15 from cubicweb import server |
|
16 |
14 |
17 def _annotate_select(annotator, rqlst): |
15 def _annotate_select(annotator, rqlst): |
18 for subquery in rqlst.with_: |
16 for subquery in rqlst.with_: |
19 annotator._annotate_union(subquery.query) |
17 annotator._annotate_union(subquery.query) |
20 #if server.DEBUG: |
18 #if server.DEBUG: |