-
Notifications
You must be signed in to change notification settings - Fork 173
Closed as not planned
Labels
enhancementNew feature or requestNew feature or request
Description
Following @jemmaissroff's suggestion, here's a list of things IRB'd need in order to use YARP instead of Ripper:
- A way to simulate the output of
Ripper.sexp. Maybe something likeYARP.lex(code).value.to_array? - A way to do simulate
Ripper::Lexer#scan. I believeYARP.lex_compatis created for this.- However, the result needs to have
:on_sptoken as noted in Investigate emitting:on_spevent for ripper lex #722 - https://github.com/ruby/irb/blob/df6907aca9c618561537e37da0ef0626f675c42c/lib/irb/color.rb#L200
- https://github.com/ruby/irb/blob/df6907aca9c618561537e37da0ef0626f675c42c/lib/irb/ruby-lex.rb#L164
- However, the result needs to have
- IRB also needs a way to map Ripper's state bits, like
Ripper::EXPR_CMDARGwith YARP's, and access them through similar constants, likeYARP::EXPR_CMDARG? - Finally, IRB will need a way to know if the current parser is YARP so it can switch to use different APIs/constants.
Let me know if I misunderstood anything or what I can improve from the IRB part 🙏
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request