Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Follow up to #1293 (comment)
Basically, I added a few
MaybeNested...Expression
s that check for a properly indented expression. And I reviewed all uses ofExtendedExpression
and a few others and decided whether to add this prefix. Mostly right-hand sides of assignments get this new treatment.However, because we fallback to not-properly-nested parsing, it's still the case that
a =\n x\n y
parses as a function call. As a result of this, I can't actually think up a situation where this PR affects compilation. But it makes me feel more confident thatPushIndent
will have the correct indentation in some future situations... but given that it doesn't matter yet, it's also plausible that this part of the PR should wait. What do you think? (Alternatively, we could try to be stricter: when the expression startsFurtherIndented
, it must be properly nested. I'm not sure whether this would work well in practice though... we're maybe used to having weirdly (non)indented expressions.)Also added missing feature of
throw
ing a nested expression, using the (existing but renamed)MaybeParenNestedExtendedExpression
. This parallels existing features forreturn
andyield
.Also renamed
MaybeIndentedType
toMaybeNestedType
for consistency.