Closed djlindstr closed 6 years ago
OK, this is a corner of Groovy syntax that I'm not familiar with. What is b[3]+
and how does it differ from b[3] +
?
The code and tests generally look good 👍. I agree your changes to formatting were worth doing, but please keep them in separate commits in future so it's easier to review logic changes :)
Good point about splitting the commits.
Well, there is no requirement to have whitespace between tokens, although it is considered good style. def a=b[3]+1
is the same as def a = b[3] + 1
. So if a line break is inserted, it should be handled in the same way.
Oh, gotcha. I misunderstood before: I thought you were saying that foo+
shouldn't indent the next line, but you were actually saying that it should indent the next line and currently isn't.
Thanks :)
This PR tries to fix #111. While working with the code, I discovered a few other indentation errors which are also fixed, e.g.
etc.
I also did some changes to the formatting of the indentation unit tests, for better readability (IMHO). It was hard to visually line up some of the tests as the first line was Lisp-indented, so I have started each test string with a line-break.