This repository was archived by the owner on Jun 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 38
Add spread element check when the last element is a spread. #673
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cristianoc
reviewed
Oct 13, 2022
cristianoc
reviewed
Oct 13, 2022
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 -> |
There was a problem hiding this comment.
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 *)
cristianoc
reviewed
Oct 13, 2022
There was a problem hiding this 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.
OK, I'll try that. |
I think I have done it, please check again. Thank you for reviewing! |
cristianoc
approved these changes
Oct 13, 2022
57 tasks
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
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.