Closed sorawee closed 6 years ago
@belph this is really awkward to handle, since we need to determine if something is a tuple or an object...
I think this is closely related:
fun a():
{a(a)}
block:
a
end
end
should be indented as:
fun a():
{a(a)}
block:
a
end
end
Weirdly in this case only block
would trigger the problem. Other constructs like lam
or fun
does not cause a problem.
(We have about 3 Piazza posts complaining this bug today...)
Sorry, this is a fiddly one to figure out. Tuples and shorthand lambdas and objects are easy to mistake for one another. @belph it looks like the problem here is that you're too eager to say "if I see an LPAREN when there's a 'braced-expr on top of the stack, treat it as a lambda" -- it needs to be a LPAREN that immediately follows an LBRACE. I tried adding a check at the end of the indenter that says if I see an identifier when I have 'braced-expr on the top of the stack, turn it into an 'object instead. But that gives weird indentation too. Could you take a look please?
Apologies; this slipped through my inbox. If I can't get to it before then, I'll take a look this weekend.
I had time before then. It should be fixed in brownplt/pyret-codemirror-mode@34f9da9. I'll close this now, despite the inevitable bug @blerner will find with the fixing commit.
pyret.el, too, please?
@blerner: Should I update master
or horizon
?
As I understand, the answer is horizon.
should be indented as:
But currently it doesn't.