diff options
| author | LV-426 <lv-426@taproot.org.il> | 2015-03-31 23:14:25 +0300 |
|---|---|---|
| committer | LV-426 <lv-426@taproot.org.il> | 2015-04-01 22:25:55 +0300 |
| commit | b859ff77b2b3984342c2ccf91ec2850d90942281 (patch) | |
| tree | cd35e6f75f18e6f9a4c7e3087e9f6b52a83de3f1 /src/server/neo4j_cypher_parser.py | |
| parent | 6171267ed2e2f9f023e74727af33d742bdd00bc1 (diff) | |
neo4j_cypher_parser: sub_exp_set_by_type(): return ctx by default
Diffstat (limited to 'src/server/neo4j_cypher_parser.py')
| -rw-r--r-- | src/server/neo4j_cypher_parser.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/server/neo4j_cypher_parser.py b/src/server/neo4j_cypher_parser.py index 83dffadb..d83e93f8 100644 --- a/src/server/neo4j_cypher_parser.py +++ b/src/server/neo4j_cypher_parser.py @@ -213,13 +213,11 @@ class pt_abs_composite_node(pt_abs_node): for exp_type in exp_type_set: if isinstance(n, exp_type): ctx += [n] - ctx = [] if False == recurse: - f_recurse = lambda _n, _ctx, _depth: False # do not recurse + f_recurse = lambda _n, _ctx, depth: depth <= 1 # [!] visit child nodes only if True == recurse: f_recurse = lambda _n, _ctx, _depth: True # recurse - self.tree_walk__pre(f_visit=f_visit, f_recurse=f_recurse, ctx=ctx) - return ctx + return self.tree_walk__pre(f_visit=f_visit, f_recurse=f_recurse, ctx=[]) def tree_walk__pre(self, f_pre=lambda n, ctx: None, f_visit=lambda n, ctx, depth: None, @@ -246,6 +244,7 @@ class pt_abs_composite_node(pt_abs_node): f_post(n, ctx) walk__pre_rec(self, 0) + return ctx class e_keyword(pt_abs_node): |
