Skip to content

Conversation

smarter
Copy link
Member

@smarter smarter commented Dec 11, 2019

Previously, outline parsing would have failed on indent1.scala with:

7 |  end inner
  |  ^
  |  misaligned end marker

because OutlineParserCommon#skipBraces does not update
in.openEndMarkers, but calls in.nextToken which eventually calls
in.skipEndMarker which checks that end markers are aligned.

This commit fixes this by adding a boolean in the scanner to turn off
end marker checks, this is used by the outline parser when skipping over
code.

@smarter smarter added this to the 0.21 Tech Preview milestone Dec 11, 2019
@smarter smarter requested a review from odersky December 11, 2019 16:08
We were not testing some files previously, and one of the file did not
actually typecheck.
Previously, outline parsing would have failed on indent1.scala with:

7 |  end inner
  |  ^
  |  misaligned end marker

because `OutlineParserCommon#skipBraces` does not update
`in.openEndMarkers`, but calls `in.nextToken` which eventually calls
`in.skipEndMarker` which checks that end markers are aligned.

This commit fixes this by adding a boolean in the scanner to turn off
end marker checks, this is used by the outline parser when skipping over
code.
@smarter smarter force-pushed the sourcepath-end-marker branch from 916eb5b to 8e57890 Compare December 11, 2019 16:23
@smarter smarter merged commit 1214da3 into scala:master Dec 11, 2019
@smarter smarter deleted the sourcepath-end-marker branch December 11, 2019 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants