whitequark / parser

A Ruby parser.
Other
1.57k stars 197 forks source link

Update for Ruby 3.3.1 #1009

Closed kstevens715 closed 2 months ago

kstevens715 commented 2 months ago

Ruby 3.3.1 was released yesterday: https://www.ruby-lang.org/en/news/2024/04/23/ruby-3-3-1-released/.

Is it possible to do a 3.3.1.0 release for parser?

I like to keep the following in my Gemfile so that parser tracks the version of Ruby I'm using. But this is currently failing when trying Ruby 3.3.1 because there's not yet an equivalent version of Parser:

gem 'parser', "~> #{@ruby_version.gem_version}"

I made this change to my Gemfile because the last few times I updated Ruby I would subsequently realize I was getting warnings and would manually update parser. Using this syntax in the Gemfile ensures I do not forget to update `parser.

iliabylich commented 2 months ago

3.3.1 is special, there is a grammar change that needs to be implemented first - https://github.com/whitequark/parser/issues/963#issuecomment-2072900550.

dgollahon commented 2 months ago

Hey @iliabylich, not to rush/pressure you but wondering if you have an approximate ETA on when this would be patched/released? If it's relatively simple to do and I could help with it, let me know.

iliabylich commented 2 months ago

Yes, this is pretty annoying. I'm so used to backporting changes after Christmas in a single huge batch and I completely forgot about this :)

I'll take a look today, need to refresh my knowledge of parser's internals.

dgollahon commented 2 months ago

FWIW I'm not sure if you're trying to preserve parity with the difference between 3.3.0 and 3.3.1 in parser, but since the 3.3.0 behavior was a bug I think you could fix forward and not preserve any of that (if you were trying to do that). prism, for instance, never had this behavior.

iliabylich commented 2 months ago

Each parser class simply follows X.Y.<LATEST>, this is why parser warnings about incompatible syntax exist. Once it's backported Parser::Ruby33 will be 3.3.1 compatible (and 3.3.0 incompatible in terms of rejecting invalid syntax that is no longer rejected on 3.3.1). I hope it doesn't sound very confusing.

iliabylich commented 2 months ago

parser 3.3.1.0 has been released.

dgollahon commented 2 months ago

parser 3.3.1.0 has been released.

Thank you for the quick turnaround!