You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the CGenerator class with reduce_parentheses=True, the output still includes unnecessary parentheses around instances of UnaryOp with the NOT operator.
For example:
Input: if (a && !b && (!c || d)) …
Output: if (a && (!b) && ((!c) || d)) …
Expected Output: if (a && !b && (!c || d)) …
To get around this, I just included UnaryOp in the list of simple nodes for _is_simple_node. Though, I'm not sure if this would have unexpected consequences. Another possible solution would be to include it in the precedence_map, but I couldn't get an ideal output doing it that way.
The text was updated successfully, but these errors were encountered:
included UnaryOp in the list of simple nodes for _is_simple_node. Though, I'm not sure if this would have unexpected consequences. Another possible solution would be to include it in the precedence_map, but I couldn't get an ideal output doing it that way.
(&pointer)++ and &(pointer++) for example have different meanings. There would have to be a priority check like with binary operators
When using the CGenerator class with reduce_parentheses=True, the output still includes unnecessary parentheses around instances of UnaryOp with the NOT operator.
For example:
To get around this, I just included UnaryOp in the list of simple nodes for _is_simple_node. Though, I'm not sure if this would have unexpected consequences. Another possible solution would be to include it in the precedence_map, but I couldn't get an ideal output doing it that way.
The text was updated successfully, but these errors were encountered: