Skip to content

Commit

Permalink
Support Ruby 3.5 for Prism::Translation::Parser
Browse files Browse the repository at this point in the history
Follow up #3336.

Development for Ruby 3.5 has begun on the master branch:
ruby/ruby@2f064b3
  • Loading branch information
koic committed Dec 25, 2024
1 parent 3c4851c commit aa49c1b
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/prism/translation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ module Translation # steep:ignore
autoload :Parser, "prism/translation/parser"
autoload :Parser33, "prism/translation/parser33"
autoload :Parser34, "prism/translation/parser34"
autoload :Parser35, "prism/translation/parser35"
autoload :Ripper, "prism/translation/ripper"
autoload :RubyParser, "prism/translation/ruby_parser"
end
Expand Down
2 changes: 2 additions & 0 deletions lib/prism/translation/parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,8 @@ def convert_for_prism(version)
"3.3.1"
when 34
"3.4.0"
when 35
"3.5.0"
else
"latest"
end
Expand Down
12 changes: 12 additions & 0 deletions lib/prism/translation/parser35.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# frozen_string_literal: true

module Prism
module Translation
# This class is the entry-point for Ruby 3.5 of `Prism::Translation::Parser`.
class Parser35 < Parser
def version # :nodoc:
35
end
end
end
end
2 changes: 2 additions & 0 deletions prism.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ Gem::Specification.new do |spec|
"lib/prism/translation/parser.rb",
"lib/prism/translation/parser33.rb",
"lib/prism/translation/parser34.rb",
"lib/prism/translation/parser35.rb",
"lib/prism/translation/parser/compiler.rb",
"lib/prism/translation/parser/lexer.rb",
"lib/prism/translation/ripper.rb",
Expand All @@ -116,6 +117,7 @@ Gem::Specification.new do |spec|
"rbi/prism/translation/parser.rbi",
"rbi/prism/translation/parser33.rbi",
"rbi/prism/translation/parser34.rbi",
"rbi/prism/translation/parser35.rbi",
"rbi/prism/translation/ripper.rbi",
"rbi/prism/visitor.rbi",
"sig/prism.rbs",
Expand Down
6 changes: 6 additions & 0 deletions rbi/prism/translation/parser35.rbi
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# typed: strict

class Prism::Translation::Parser35 < Prism::Translation::Parser
sig { override.returns(Integer) }
def version; end
end

0 comments on commit aa49c1b

Please sign in to comment.