Greedy newlines with `return`
Closed this issue · 3 comments
WreckedAvent commented
Input:
syntax fun = function(ctx) {
let param = ctx.next().value;
let body = ctx.next().value.inner();
return #`
function(${param}) {
return ${body};
}
`;
}
let add = fun x { x + 1 }
Actual:
let add_1264 = function (x_1265) {
return;
x_1265 + 1;
};
Expected:
let add_1264 = function (x_1265) {
return x_1265 + 1;
};
WreckedAvent commented
Also, based on some of the documentation, I thought I might have needed to this:
syntax fun = function(ctx) {
let param = ctx.next().value;
let body = ctx.next().value.inner();
return #`
function(${param}) {
return ${body.expand('expr').value};
}
`;
}
let add = fun x { x + 1 }
But the emit is the same.
gabejohnson commented
disnet commented
That's annoying. I thought I fixed this and had regression tests.