Skip to content

Conversation

@auduchinok
Copy link
Member

@auduchinok auduchinok commented Oct 8, 2021

When parsing matchExpr, use successfully parsed ranges instead of the possibly recovered range.

Consider an anon module with two expressions: an unfinished match expression followed by an identifier expression:

match () with
| a
b

Using the recovered range makes b range belong to both expressions, which is not correct. This PR restricts the ranges to last successfully parts which fixes things in recovery productions.

@auduchinok auduchinok changed the title Parser: correct range for recovered match clause Parser: fix range for recovered match clause Oct 8, 2021
@dsyme dsyme merged commit e100f2f into dotnet:main Oct 8, 2021
@dsyme
Copy link
Contributor

dsyme commented Oct 8, 2021

Great work!

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