Skip to content

Comments

Add Ruby 4.0 support via Prism parser#9

Merged
JPDuchesne merged 1 commit intomasterfrom
jpd/ruby4-support
Feb 21, 2026
Merged

Add Ruby 4.0 support via Prism parser#9
JPDuchesne merged 1 commit intomasterfrom
jpd/ruby4-support

Conversation

@JPDuchesne
Copy link
Contributor

@JPDuchesne JPDuchesne commented Feb 21, 2026

Summary

  • Switch from Parser::CurrentRuby to Prism::Translation::Parser for future-proof Ruby 4.0+ syntax support
  • On Ruby 4.0, Parser::CurrentRuby silently falls back to Parser::Ruby33 since the parser gem doesn't know about Ruby 4.0 yet. This works for now but won't handle Ruby 4.0-specific syntax.
  • Prism::Translation::Parser is a drop-in replacement (extends Parser::Base, same interface) and uses Ruby's built-in Prism parser
  • Use Prism::Translation::Parser::Builder as default builder (avoids deprecation warning)
  • Add explicit prism runtime dependency (was already a transitive dependency via unparser)
  • Add Ruby 4.0 to CI matrix (3.2, 3.3, 4.0)
  • Bump version to 2.1.0

Test plan

  • All 30 tests pass on Ruby 3.3
  • All 30 tests pass on Ruby 4.0
  • CI passes on Ruby 3.2, 3.3, 4.0

Made with Cursor

Switch from Parser::CurrentRuby to Prism::Translation::Parser for
future-proof Ruby 4.0+ syntax support. Parser::CurrentRuby silently
falls back to Ruby33 parser on Ruby 4.0 since the parser gem doesn't
know about it yet.

- Replace Parser::CurrentRuby with Prism::Translation::Parser
- Use Prism::Translation::Parser::Builder as default builder
- Add explicit prism runtime dependency
- Add Ruby 4.0 to CI matrix
- Bump version to 2.1.0

Co-authored-by: Cursor <cursoragent@cursor.com>
@codecov
Copy link

codecov bot commented Feb 21, 2026

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment

Thanks for integrating Codecov - We've got you covered ☂️

@JPDuchesne JPDuchesne merged commit f85163a into master Feb 21, 2026
4 checks passed
@JPDuchesne JPDuchesne deleted the jpd/ruby4-support branch February 21, 2026 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant