Currently, parentheses are always inserted when creating an expression (unless $insertParentheses is false). This leads to less readable expressions: compare ((a AND b) OR (c AND d)) to a AND b OR c AND d.
I propose to only insert parentheses when this is required by precedence rules. There is no explicit document on the precedence of operators in Cypher AFAIK, but it can be derived from the grammar:
IN, STARTS WITH, ENDS WITH, CONTAINS, =~, IS NULL, IS NOT NULL
+, - (unary)
^
*, /, %
+, - (binary)
=, <>, <, >, <=, >=
NOT
AND
XOR
OR
Currently, parentheses are always inserted when creating an expression (unless
$insertParenthesesisfalse). This leads to less readable expressions: compare((a AND b) OR (c AND d))toa AND b OR c AND d.I propose to only insert parentheses when this is required by precedence rules. There is no explicit document on the precedence of operators in Cypher AFAIK, but it can be derived from the grammar:
IN,STARTS WITH,ENDS WITH,CONTAINS,=~,IS NULL,IS NOT NULL+,-(unary)^*,/,%+,-(binary)=,<>,<,>,<=,>=NOTANDXOROR