-
Notifications
You must be signed in to change notification settings - Fork 185
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
ripper is missing in the standard library #1585
Comments
@deepj Thanks for the report. |
It's a stdlib and it's a rather portable way to get an AST out of Ruby source code, so we should support it at some point, but so far it doesn't seem a priority. |
@eregon definitely it's not a priority. The Yes, the purpose of skippa is parse schema.rb without evaluating it. |
@eregon: just to rdoc, at least many rdoc tests fail on the issue |
busser is one I've just come across. It's frequently used with Test Kitchen for testing provisioning scripts in devops environments. |
We've stubbed |
Another library uses it. cane from Square |
An idea to get Ripper support and not have to maintain a lot of code would be to reuse the Ripper C extension from MRI sources. Tracked internally as GR-20329. |
My approach is to copy across ripper as a C extension, and then copy across supporting parts of MRI as needed, hacking it around to work in TruffleRuby, and that's sort of where I left it. |
Ripper is now implemented at commit: 7bdeca8. |
Thanks @bjfish! Could you talk about how you did this in the end? Would make a great blog post to say that we finally implement this. |
@chrisseaton This was implemented using the C extension. First step was getting this to compile. Then, running new specs and MRI tests while fixing any issues that came up. This resulted in a lot of C API compatibility fixes that were implemented in separate PRs with new C API specs. For testing, it passes all of the Ripper MRI tests that were practical to to run ( |
See https://ruby-doc.org/stdlib-2.0.0/libdoc/ripper/rdoc/Ripper.html
To reproduce:
Error:
The text was updated successfully, but these errors were encountered: