Module: Prism::Translation::Parser::ProcessedSource
- Defined in:
- lib/prism/translation/parser/rubocop.rb
Overview
This module gets prepended into RuboCop::AST::ProcessedSource.
Instance Method Summary collapse
-
#parser_class(ruby_version, _parser_engine) ⇒ Object
Redefine parser_class so that we can inject the prism parser into the list of known parsers.
Instance Method Details
#parser_class(ruby_version, _parser_engine) ⇒ Object
Redefine parser_class so that we can inject the prism parser into the list of known parsers.
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File '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 |