Skip to content

Commit 86406f6

Browse files
committed
Fix the ripper translator to parse as the current ruby
Otherwise, it uses the latest prism version
1 parent f4363ba commit 86406f6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/prism/translation/ripper.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def self.parse(src, filename = "(ripper)", lineno = 1)
7171
# [[1, 13], :on_kw, "end", END ]]
7272
#
7373
def self.lex(src, filename = "-", lineno = 1, raise_errors: false)
74-
result = Prism.lex_compat(src, filepath: filename, line: lineno)
74+
result = Prism.lex_compat(src, filepath: filename, line: lineno, version: "current")
7575

7676
if result.failure? && raise_errors
7777
raise SyntaxError, result.errors.first.message
@@ -3295,7 +3295,7 @@ def visit_yield_node(node)
32953295

32963296
# Lazily initialize the parse result.
32973297
def result
3298-
@result ||= Prism.parse(source, partial_script: true)
3298+
@result ||= Prism.parse(source, partial_script: true, version: "current")
32993299
end
33003300

33013301
##########################################################################

0 commit comments

Comments
 (0)