Pretty printing of Core does not group nested statements
phischu opened this issue · comments
phischu commented
Consider the following program:
def main() = {
var i = 0;
i = i + 1;
()
}
It gets transformed to the following Core:
def main751() =
val tmp759763 = 0;
var i750 = tmp759763 ;
let tmp760764 = i750.get();
let tmp765 = i750.put(infixAdd27(tmp760764, 1))
tmp765;
()
This looked confusing to me at first. Inspecting the tree, the following would be clearer to me:
def main751() =
val tmp759763 = 0;
var i750 = tmp759763 ;
val __766 = {
let tmp760764 = i750.get();
let tmp765 = i750.put(infixAdd27(tmp760764, 1));
tmp765
};
()
Alternatively the val __766 =
could be left out since it is unused, but I like that it emphasizes that we are pushing a frame respectively generating a monadic bind here.