module Prism::Translation::Parser::ProcessedSource

This module gets prepended into RuboCop::AST::ProcessedSource.

Public Instance Methods

parser_class(ruby_version) click to toggle source

Redefine parser_class so that we can inject the prism parser into the list of known parsers.

Calls superclass method
# File lib/prism/translation/parser/rubocop.rb, line 28
def parser_class(ruby_version)
  if ruby_version == Prism::Translation::Parser::VERSION_3_3
    require "prism/translation/parser33"
    Prism::Translation::Parser33
  elsif ruby_version == Prism::Translation::Parser::VERSION_3_4
    require "prism/translation/parser34"
    Prism::Translation::Parser34
  else
    super
  end
end