| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
module Prism |
| 7 |
module Translation |
| 8 |
case RUBY_VERSION |
| 9 |
when /^3\.3\./ |
| 10 |
ParserCurrent = Parser33 |
| 11 |
when /^3\.4\./ |
| 12 |
ParserCurrent = Parser34 |
| 13 |
when /^3\.5\./, /^4\.0\./ |
| 14 |
ParserCurrent = Parser40 |
| 15 |
when /^4\.1\./ |
| 16 |
ParserCurrent = Parser41 |
| 17 |
else |
| 18 |
|
| 19 |
parser = Parser40 |
| 20 |
major, minor, _patch = Gem::Version.new(RUBY_VERSION).segments |
| 21 |
warn "warning: `Prism::Translation::Current` is loading #{parser.name}, " \ |
| 22 |
"but you are running #{major}.#{minor}." |
| 23 |
ParserCurrent = parser |
| 24 |
end |
| 25 |
end |
| 26 |
end |