Skip to content

Commit

Permalink
+ Register a Ruby 3.4 parser (#991)
Browse files Browse the repository at this point in the history
To avoid failing when running as part of ruby-head test builds.

I did the same as previous years, just initialized 3.4 as a copy
of 3.3.

Co-authored-by: Jean Boussier <jean.boussier@gmail.com>
  • Loading branch information
casperisfine and byroot authored Jan 15, 2024
1 parent 3a03d71 commit eb6436d
Show file tree
Hide file tree
Showing 8 changed files with 3,207 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,6 @@ lib/parser/ruby30.rb
lib/parser/ruby31.rb
lib/parser/ruby32.rb
lib/parser/ruby33.rb
lib/parser/ruby34.rb
lib/parser/macruby.rb
lib/parser/rubymotion.rb
1 change: 1 addition & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ GENERATED_FILES = %w(lib/parser/lexer-F0.rb
lib/parser/ruby31.rb
lib/parser/ruby32.rb
lib/parser/ruby33.rb
lib/parser/ruby34.rb
lib/parser/macruby.rb
lib/parser/rubymotion.rb)

Expand Down
1 change: 1 addition & 0 deletions lib/parser/all.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@
require 'parser/ruby31'
require 'parser/ruby32'
require 'parser/ruby33'
require 'parser/ruby34'
9 changes: 9 additions & 0 deletions lib/parser/current.rb
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,15 @@ def warn_syntax_deviation(feature, version)
require 'parser/ruby33'
CurrentRuby = Ruby33

when /^3\.4\./
current_version = '3.4.0'
if RUBY_VERSION != current_version
warn_syntax_deviation 'parser/ruby34', current_version
end

require 'parser/ruby34'
CurrentRuby = Ruby34

else # :nocov:
# Keep this in sync with released Ruby.
warn_syntax_deviation 'parser/ruby33', '3.3.x'
Expand Down
Loading

0 comments on commit eb6436d

Please sign in to comment.