Skip to content

Conversation

@Earlopain
Copy link
Collaborator

Ripper exposes Ripper::Lexer:State in its output, which is a bit of a problem. To make this work, I basically copy-pasted the implementation.

I'm unsure if that is acceptable and added a test to make sure that these values never go out of sync.
I don't imagine them changing often, prism maps them 1:1 for its own usage.

This also fixed the shim by accident. Ripper.lex went to Translation::Ripper.lex when it should have been the original. Removing the need for the original resolves that issue.

See #3838

cc @eregon I was actually checking this out after you made https://bugs.ruby-lang.org/issues/21827.

It has a hard dependency on ripper that can't be removed.
This makes it so that ripper can be loaded only when the class is actually used.
Ripper is either not used or loaded where it is actually needed
Ripper exposes Ripper::Lexer:State in its output, which is a bit of a problem. To make this work, I basically copy-pasted the implementation.

I'm unsure if that is acceptable and added a test to make sure that these values never go out of sync.
I don't imagine them changing often, prism maps them 1:1 for its own usage.

This also fixed the shim by accident. `Ripper.lex` went to `Translation::Ripper.lex` when it should have been the original. Removing the need for the original resolves that issue.
@Earlopain Earlopain force-pushed the ripper-translator-untangle branch 2 times, most recently from 7841970 to 2c0bea0 Compare January 8, 2026 13:08
@Earlopain Earlopain marked this pull request as ready for review January 8, 2026 13:16
Copy link
Collaborator

@kddnewton kddnewton left a comment

Choose a reason for hiding this comment

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

Wow, yeah looks great.

@kddnewton kddnewton merged commit 451f70e into ruby:main Jan 8, 2026
66 checks passed
@eregon
Copy link
Member

eregon commented Jan 8, 2026

Amazing, thank you, I'll try it soon.

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.

3 participants