Skip to content

Use RubyVM::InstructionSequence for callable source #53055

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

Merged
merged 1 commit into from
Sep 29, 2024

Conversation

kddnewton
Copy link
Contributor

@kddnewton kddnewton commented Sep 26, 2024

This ensures it works regardless of the parser, and does not require reparsing the original source.

This is in response to a ping on #53054.

cc @byroot

This ensures it works regardless of the parser, and does not require
reparsing the original source.
@byroot byroot merged commit 4f4e7a7 into rails:main Sep 29, 2024
3 checks passed
YusukeIwaki added a commit to YusukeIwaki/playwright-ruby-client that referenced this pull request Feb 2, 2025
…d of RubyVM::AbstractSyntaxTree.

Ruby 3.4 introduces new Ruby parser called Prism.
`RubyVM::AbstractSyntaxTree.of` raises an error: RubyVM::AbstractSyntaxTree.of: cannot get AST for ISEQ compiled by prism

Essentially, extracting source codes from the file does not require parsing.
InstructionSequence is better to do it.

ref:
 - https://bugs.ruby-lang.org/issues/20761
 - rails/rails#53055
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants