nodesEqual returns true when a and b render to identical strings. This is used as a conservative structural-equality test: if two nodes render identically they are semantically equivalent in the expression.
(a, b ConditionNode)
| 104 | // This is used as a conservative structural-equality test: if two nodes |
| 105 | // render identically they are semantically equivalent in the expression. |
| 106 | func nodesEqual(a, b ConditionNode) bool { |
| 107 | if a == nil || b == nil { |
| 108 | return a == nil && b == nil |
| 109 | } |
| 110 | return a.Render() == b.Render() |
| 111 | } |
| 112 | |
| 113 | // isNegationOf returns true when b is the logical negation of a or a is the |
| 114 | // logical negation of b (handles both A / !A and !A / A cases). |