Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Recover from missing argument in call expressions #16124

Merged
merged 2 commits into from
Feb 8, 2024

Conversation

ohno418
Copy link
Contributor

@ohno418 ohno418 commented Dec 14, 2023

Previously, when parsing an argument list with a missing argument (e.g., (a, , b) in foo(a, , b)), the parser would stop upon an unexpected token (at the second comma in the example), resulting in an incorrect parse tree.

This commit improves error handling in such cases, ensuring a more accurate parse tree is built.


Fixes #15683.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 14, 2023
@Veykril Veykril added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 15, 2023
ohno418 and others added 2 commits February 8, 2024 10:54
Previously, when parsing an argument list with a missing argument (e.g.,
`(a, , b)` in `foo(a, , b)`), the parser would stop upon an unexpected
token (at the second comma in the example), resulting in an incorrect
parse tree.

This commit improves error handling in such cases, ensuring a more
accurate parse tree is built.
@Veykril
Copy link
Member

Veykril commented Feb 8, 2024

I'm cleaning up our PRs so I've went and finished the PR. Thanks for the work!
@bors r+

@bors
Copy link
Collaborator

bors commented Feb 8, 2024

📌 Commit 974e69b has been approved by Veykril

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Feb 8, 2024

⌛ Testing commit 974e69b with merge 5c80ad0...

@bors
Copy link
Collaborator

bors commented Feb 8, 2024

☀️ Test successful - checks-actions
Approved by: Veykril
Pushing 5c80ad0 to master...

@bors bors merged commit 5c80ad0 into rust-lang:master Feb 8, 2024
11 checks passed
@ohno418
Copy link
Contributor Author

ohno418 commented Feb 8, 2024

@Veykril
Thank you for taking care of this! I haven't had time to work on this recently.

@ohno418 ohno418 deleted the call-expr-missing-arg branch February 8, 2024 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

missing argument in call expression has bad recovery
5 participants