Avoid proliferation of parenthesis
The str() function of the parse tree now emits expressions with much less parenthesis. This should allow optimized queries to be more readable.
This commit is contained in:
parent
e4e3eae8ce
commit
6bc219c635
@ -277,11 +277,8 @@ class Node (object):
|
||||
elif (self.kind == UNARY):
|
||||
return self.name + " " + self.prop + " (" + self.child.__str__() + ")"
|
||||
elif (self.kind == BINARY):
|
||||
if self.left.kind == RELATION:
|
||||
le = self.left.__str__()
|
||||
else:
|
||||
le = "(" + self.left.__str__() + ")"
|
||||
if self.right.kind == RELATION:
|
||||
le = self.left.__str__()
|
||||
if self.right.kind != BINARY:
|
||||
re = self.right.__str__()
|
||||
else:
|
||||
re = "(" + self.right.__str__() + ")"
|
||||
|
Loading…
x
Reference in New Issue
Block a user