-
Notifications
You must be signed in to change notification settings - Fork 164
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve printing of nested expressions
Specifically, make it better at eliding redundant parenthesis. We do so by changing the code so that the PrintPrecedence is reset to 0 whenever a expression is print that is not a unary or binary op, and then restored afterwards. For "leave" expressions such as integer literals this has no effect. But for expression that can have further subexpressions, such as function expressions, list expression, permutation expressions etc., this allows us to avoid redundant parenthesis.
- Loading branch information
Showing
2 changed files
with
57 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters