Some simple improvements to MIR pretty printing#33607
Merged
bors merged 3 commits intorust-lang:masterfrom May 15, 2016
jonas-schievink:prettier-mir
Merged
Some simple improvements to MIR pretty printing#33607bors merged 3 commits intorust-lang:masterfrom jonas-schievink:prettier-mir
bors merged 3 commits intorust-lang:masterfrom
jonas-schievink:prettier-mir
Conversation
In short, this PR changes the MIR printer so that it: * places an empty line between the MIR for each item * does *not* write an empty line before the first BB when there are no var decls * aligns the "// Scope" comments 50 chars in (makes the output more readable) * prints the scope comments as "// scope N at ..." instead of "// Scope(N) at ..." * prints a prettier scope tree: * no more unbalanced delimiters! * no more "Parent" entry (these convey no useful information) * drop the "Scope()" and just print scope IDs * no braces when the scope is empty
Contributor
|
r? @nrc (rust_highfive has picked a reviewer for you, use r? to override) |
Contributor
Author
|
I'll make the scope tree printing much smaller tomorrow, so hang on until then :) |
Contributor
|
🐊 this looks great, thanks for doing this. |
Member
|
I feel like scope tree would look better like this: |
40 chars is still enough indentation (most common MIR statements don't take more than 40 chars), and fits more easily in 80-character terminals.
Contributor
Author
|
Updated. Also put a |
Member
|
@bors r+ Thank you! |
Collaborator
|
📌 Commit 2c7e398 has been approved by |
Collaborator
bors
added a commit
that referenced
this pull request
May 15, 2016
Some simple improvements to MIR pretty printing In short, this PR changes the MIR printer so that it: * places an empty line between the MIR for each item * does *not* write an empty line before the first BB when there are no var decls * aligns the "// Scope" comments 50 chars in (makes the output more readable) * prints the scope comments as "// scope N at ..." instead of "// Scope(N) at ..." * prints a prettier scope tree: * no more unbalanced delimiters! * no more "Parent" entry (these convey no useful information) * drop the "Scope()" and just print scope IDs * no braces when the scope is empty In action: https://gist.github.com/jonas-schievink/1c11226cbb112892a9470ce0f9870b65
Collaborator
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In short, this PR changes the MIR printer so that it:
var decls
readable)
Scope(N) at ..."
In action: https://gist.github.com/jonas-schievink/1c11226cbb112892a9470ce0f9870b65