def reduce_Expr_IndirectionEl(self, *kids): expr = kids[0].val if isinstance(expr, qlast.Indirection): self.val = expr expr.indirection.append(kids[1].val) else: self.val = qlast.Indirection(arg=expr, indirection=[kids[1].val])
def visit_IndexIndirection(self, node): result = qlast.Indirection( arg=self.visit(node.expr), indirection=[ qlast.Index( index=self.visit(node.index) ) ] ) return result
def visit_SliceIndirection(self, node): start = self.visit(node.start) if node.start is not None else None stop = self.visit(node.stop) if node.stop is not None else None result = qlast.Indirection( arg=self.visit(node.expr), indirection=[ qlast.Slice( start=(None if self._is_none(start) else start), stop=(None if self._is_none(stop) else stop), ) ]) return result