Skip to content
This repository was archived by the owner on Jun 15, 2023. It is now read-only.

Add spread element check when the last element is a spread. #673

Merged
merged 8 commits into from
Oct 13, 2022

Conversation

butterunderflow
Copy link
Contributor

The current behavior is: if the last list element expression is a spread, the parser will not check the rest element whether contains a spread expression.
This PR adds a spread element check when the last list element is a spread.
Please see #670 for more details.

src/res_core.ml Outdated
@@ -3724,17 +3732,10 @@ and parseListExpr ~startPos p =
let loc = mkLoc startPos p.prevEndPos in
match listExprs with
| (true, expr) :: exprs ->
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps add comment true (* spread *)

Copy link
Contributor

@cristianoc cristianoc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good.
A few comments on pre-existing typos in the error message, and suggestions for code cleanup.

Would you add a line to CHANGELOG.md.

@butterunderflow
Copy link
Contributor Author

OK, I'll try that.

@butterunderflow
Copy link
Contributor Author

I think I have done it, please check again. Thank you for reviewing!

@cristianoc cristianoc merged commit 8adfd2b into rescript-lang:master Oct 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants