-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Avoid printing extra blocks and inline nodes #5510
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
Avoid printing extra blocks and inline nodes #5510
Conversation
5fe2c2c
to
ca35eee
Compare
e74e9d4
to
52dddce
Compare
52dddce
to
0bc7db4
Compare
Rebased |
Avoid printing extra blocks and inline nodes
0bc7db4
to
0dc0587
Compare
Rebased |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise, LGTM
@@ -777,34 +788,13 @@ trait Printers | |||
case IsValDef(tree) => !tree.symbol.flags.isObject | |||
case _ => true | |||
} | |||
printFlatBlock(stats, expr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code seems to have forgotten the case implicit object A
.
extractFlatStats(it.next()) | ||
val flatExpr = extractFlatExpr(expr) | ||
(flatStats.result(), flatExpr) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code smell for flatBlock
: is there a way to simplify the code and logic?
val init :+ last = stats2 | ||
(init, last) | ||
case _ => (stats2, expr1) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Remove Term.Lambda
logic seems to belong to somewhere else .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the decompiler, Term.Lambda
are no-op
/no-print
trees that must be removed from the blocks. We need to remove them here because they might affect the block flattening.
Avoid printing extra blocks and inline nodes