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

IRB support #930

Closed
st0012 opened this issue May 30, 2023 · 5 comments
Closed

IRB support #930

st0012 opened this issue May 30, 2023 · 5 comments
Labels
enhancement New feature or request

Comments

@st0012
Copy link
Member

st0012 commented May 30, 2023

Following @jemmaissroff's suggestion, here's a list of things IRB'd need in order to use YARP instead of Ripper:

Let me know if I misunderstood anything or what I can improve from the IRB part 🙏

@st0012 st0012 changed the title TODOs for IRB support IRB support May 30, 2023
@eregon
Copy link
Member

eregon commented May 31, 2023

Regarding :on_sp is it really necessary? (not for/against it, I just want to understand the need for it)
From what I understand of #722 (calculating leading whitespace), maybe it could be done with just line[/^\s*/]?

@tompng
Copy link
Member

tompng commented Jun 2, 2023

is it possible we reduce RubyLex's coupling on Ripper state bits?

Yes, it's possible. For example in ruby/irb#500, use of token.state.allbits?(Ripper::EXPR_SOMETHING) is reduced. (17 deletion, 4 addition)

@kddnewton
Copy link
Collaborator

For the state bits, you can just use Ripper::EXPR_CMDARG, they map 1:1. We could copy over the constants, but in the interest of getting it working, I would say just use the existing constants.

Something I want to know is if you are trying to just use the Ripper compatibility layer or if you want to migrate fully over to using YARP.lex. Personally, I would much prefer YARP.lex. There are a couple of benefits:

@kddnewton kddnewton added the enhancement New feature or request label Jun 5, 2023
@kddnewton
Copy link
Collaborator

Hey @st0012 - I know it's been half a year, but I just wanted to check in on where we are with this. I know a lot of changes have gone into IRB since you opened this issue. Is everything here still relevant/necessary?

@st0012
Copy link
Member Author

st0012 commented Dec 6, 2023

When I opened the issue, I assumed IRB could adopt Prism when it's ready. But because IRB still needs to support Ruby 2.7 for a while, we won't be able to do that for at least another half year.
So I'm closing this issue now and will revisit it later when we're about to adopt it.

@st0012 st0012 closed this as not planned Won't fix, can't repro, duplicate, stale Dec 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants