Skip to content

Conversation

@Earlopain
Copy link

Since ruby 3.4, prism is the default parser. There is talk about deprecating ripper in https://bugs.ruby-lang.org/issues/21827.

In order to make possible, bundled/default gems need to not use ripper. Prism actually contains a compatibility layer which can be used for that. It translates the native prism ast into the format that ripper would return.

So, instead of rewriting the whole logic to use native prism, it can just use the compatiblity layer.

I would be open trying to port it to prism without the compatiblity layer if you prefer. That would entail keeping two implementations around, since prism is only able to parse ruby 3.3+ syntax. Let me know what you think.

A little bit more info: https://github.com/ruby/prism/blob/main/docs/ripper_translation.md

Since ruby 3.4, prism is the default parser. There is talk about deprecating ripper in https://bugs.ruby-lang.org/issues/21827.

In order to make possible, bundled/default gems need to not use ripper. Prism actually contains a compatibility layer which can be used for that.
It translates the native prism ast into the format that ripper would return.

So, instead of rewriting the whole logic to use native prism, it can just use the compatiblity layer.

I would be open trying to port it to prism without the compatiblity layer if you prefer. That would entail keeping two implementations around, since prism is only able to parse ruby 3.3+ syntax. Let me know what you think
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.

1 participant