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

Implement Prism -> Sorbet translation for "simple" keywords #227

Merged
merged 9 commits into from
Sep 3, 2024

Conversation

amomchilov
Copy link

@amomchilov amomchilov commented Sep 3, 2024

Motivation

These 14 Prism nodes model simple keywords, and only carry basic location information:

  1. 🧹 PM_FALSE_NODE – Already implemented. This PR just refactors it.
  2. 🆕 PM_FORWARDING_ARGUMENTS_NODE - Newly implemented in this PR.
  3. 🆕 PM_FORWARDING_PARAMETER_NODE - Newly implemented in this PR.
  4. PM_IMPLICIT_REST_NODE - Skipped for now. It's complicated.
  5. PM_IT_LOCAL_VARIABLE_READ_NODE – Skipped for now. It's complicated. See Implement Prism -> Sorbet translation for it keyword #228.
  6. PM_IT_PARAMETERS_NODE - Skipped for now. It's complicated. See Implement Prism -> Sorbet translation for it keyword #228.
  7. PM_MISSING_NODE – Skipped for now
  8. 🧹 PM_NIL_NODE – Already implemented. This PR just refactors it.
  9. 🆕 PM_REDO_NODE - Newly implemented in this PR.
  10. 🆕 PM_RETRY_NODE - Newly implemented in this PR.
  11. 🧹 PM_SELF_NODE – Already implemented. This PR just refactors it.
  12. 🆕 PM_SOURCE_ENCODING_NODE - Newly implemented in this PR.
  13. 🆕 PM_SOURCE_LINE_NODE - Newly implemented in this PR.
  14. 🧹 PM_TRUE_NODE – Already implemented. This PR just refactors it.

This PR extracts a helper for generating these more simply, and then uses it to implement more of these keywords.

Closes #91.
Closes #92.
Closes #155.
Closes #162.
Closes #168.
Closes #170.

Depends on some commits from #224.

@amomchilov amomchilov self-assigned this Sep 3, 2024
@amomchilov amomchilov marked this pull request as ready for review September 3, 2024 17:59
Copy link

@egiurleo egiurleo left a comment

Choose a reason for hiding this comment

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

🚢

@amomchilov amomchilov merged commit 73962a3 into prism Sep 3, 2024
1 check passed
@amomchilov amomchilov deleted the Alex/translate-simple-keywords branch September 3, 2024 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment