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

[PRISM] Fix bugs in compiling optional keyword parameters #9232

Merged
merged 2 commits into from Dec 14, 2023

Conversation

jemmaissroff
Copy link
Contributor

@jemmaissroff jemmaissroff commented Dec 13, 2023

This PR fixes two bugs when compiling optional keyword parameters:

  • It moves keyword parameter compilation to STEP 5 in the parameters sequence, where the rest of compilation happens. This is important because keyword parameter compilation relies on the value of body->param.keyword->bits_start which gets set in an earlier step
  • It compiles array and hash values for keyword parameters, which it didn't previously

Closes ruby/prism#2063
Closes ruby/prism#2068
Closes ruby/prism#2065

prism_compile.c Show resolved Hide resolved
prism_compile.c Outdated Show resolved Hide resolved
prism_compile.c Outdated Show resolved Hide resolved
This PR fixes two bugs when compiling optional keyword parameters:
- It moves keyword parameter compilation to STEP 5 in the parameters
sequence, where the rest of compilation happens. This is important
because keyword parameter compilation relies on the value of
body->param.keyword->bits_start which gets set in an earlier step
- It compiles array and hash values for keyword parameters, which
it didn't previously
@jemmaissroff jemmaissroff merged commit 157e6c8 into ruby:master Dec 14, 2023
97 checks passed
@jemmaissroff jemmaissroff deleted the fix-compiling-keywords branch December 14, 2023 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants