forked from tweag/nickel
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Overhaul and improve testing of the pretty printer (tweag#1532)
* Move `Type` pretty printer test into `core/src/pretty.rs` * Revamp pretty printer for `TypeF::Array` * Start overhauling and testing the Type pretty printer * Simplify pretty printer integration test * Expand pretty printer integration tests to include stdlib * continue overhauling the pretty printer * Add tests for "let" pretty printing * Ignore empty annotations in TypeAnnotation::attach_term * Get almost all pretty printer tests to pass, missing `pass/strings/symbolic_strings.ncl` * Use `Term::StrChunks` when desugaring symbolic strings * Fix missing newlines in multiline strings * Handle record patterns in let bindings * `fun` pretty printing * Update snapshot tests * Fix pretty-printer dependent test cases * Remove TODO comment * Improve formatting for record fields with metadata * Remove a redundant clone and some redundant calls to `pretty` * Consistently use `%<stuff>` for internal values * Address comments from code review * Derive `Eq` for `OpPos` * format other binary operators the same way as `&&` and `||` * Add a comment about special unary operators * Adjust grouping for field metadata annotations * Simplify `Array` pretty printing code * Document the lack of `indoc!` in `pretty_multiline_strings`
- Loading branch information
Showing
20 changed files
with
1,311 additions
and
667 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
# capture = 'stdout' | ||
# command = ['pprint-ast'] | ||
{ | ||
a | Number | default = 1, | ||
b : String | force = "some long string that goes past the 80 character line limit for pretty printing", | ||
c : { x : Number, y: Number } = { x = 999.8979, y = 500 }, | ||
d | Array std.string.NonEmpty = ["a", "list", "of", "non", "empty", "strings"], | ||
aaaaa | Number | default = 1, | ||
bbbbb : String | force = "some long string that goes past the 80 character line limit for pretty printing", | ||
ccccc : { x : Number, y: Number } = { x = 999.8979, y = 500 }, | ||
ddddd | Array std.string.NonEmpty = ["a", "list", "of", "non", "empty", "strings"], | ||
} |
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
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
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
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
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
Oops, something went wrong.