This module gets prepended into RuboCop::AST::ProcessedSource.
Instance Methods
lib/prism/translation/parser/rubocop.rb
View on GitHub
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/translation/parser/rubocop.rb, line 30
def parser_class(ruby_version)
if ruby_version == Prism::Translation::Parser::VERSION_3_3
warn "WARN: Setting `TargetRubyVersion: 80_82_73_83_77.33` is deprecated. " \
"Set to `ParserEngine: parser_prism` and `TargetRubyVersion: 3.3` instead."
require_relative "../parser33"
Prism::Translation::Parser33
elsif ruby_version == Prism::Translation::Parser::VERSION_3_4
warn "WARN: Setting `TargetRubyVersion: 80_82_73_83_77.34` is deprecated. " \
"Set to `ParserEngine: parser_prism` and `TargetRubyVersion: 3.4` instead."
require_relative "../parser34"
Prism::Translation::Parser34
else
super
end
end
Redefine parser_class
so that we can inject the prism parser into the list of known parsers.