-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pretty-printing saw-core syntax results in way too many line-breaks #1618
Comments
Also note that Prettyprinter has the |
I believe we're using |
Layout options are specified in four (!) different places in the code that I can find: saw-script/saw-core/src/Verifier/SAW/Term/Pretty.hs Lines 683 to 688 in 87ab2f3
saw-script/src/SAWScript/Position.hs Lines 41 to 43 in 87ab2f3
saw-script/heapster-saw/src/Verifier/SAW/Heapster/Permissions.hs Lines 1166 to 1168 in 87ab2f3
saw-script/heapster-saw/src/Verifier/SAW/Heapster/SAWTranslation.hs Lines 4164 to 4166 in 87ab2f3
I don't think all of these are used for pretty-printing saw-core terms, but we should still reconsider all of these. |
Ooh, yeah, that's a little embarrassing. :) Agreed, those should all definitely use a single layout function defined in Pretty.hs. |
Yeah, any that are used for printing saw-core terms should use a default layout defined in Pretty.hs. Layout configurations used for printing other types might be better off using |
Since saw-core terms so regularly exceed the 80-column width, I'm thinking that we might rather just set the page width to something astronomically large, and then just set the ribbon width to something less than 80. This way we'll get output shaped like this:
instead of like this
|
This is accomplished by using a layout with an extremely large page width, combined with a normal (64-character) ribbon width. With this setup, the pretty-printer should almost never in practice go into the bayond-the-margin mode where it prints only one token per line. Fixes #1618.
Pretty-printing a large saw-core term invariably gives you output that looks something like this:
After the first few lines, once the indentation starts to get large, the prettyprinter decides to put only one identifier or token per line, as if that's supposed to make it easier to read. It prints out so many newlines that quite often a pretty-printed term will exceed the maximum size of my terminal's scrollback buffer.
We need to change the default page width and ribbon width settings for the saw-core prettyprinter, so that we don't get such garbage output.
The text was updated successfully, but these errors were encountered: