mirror of
https://github.com/ruby/ruby.git
synced 2026-01-27 04:24:23 +00:00
[ruby/prism] Fix the ripper translator to parse as the current ruby
Otherwise, it uses the latest prism version https://github.com/ruby/prism/commit/86406f63aa
This commit is contained in:
parent
cc929bff7d
commit
c06c2203ed
@ -71,7 +71,7 @@ module Prism
|
||||
# [[1, 13], :on_kw, "end", END ]]
|
||||
#
|
||||
def self.lex(src, filename = "-", lineno = 1, raise_errors: false)
|
||||
result = Prism.lex_compat(src, filepath: filename, line: lineno)
|
||||
result = Prism.lex_compat(src, filepath: filename, line: lineno, version: "current")
|
||||
|
||||
if result.failure? && raise_errors
|
||||
raise SyntaxError, result.errors.first.message
|
||||
@ -3295,7 +3295,7 @@ module Prism
|
||||
|
||||
# Lazily initialize the parse result.
|
||||
def result
|
||||
@result ||= Prism.parse(source, partial_script: true)
|
||||
@result ||= Prism.parse(source, partial_script: true, version: "current")
|
||||
end
|
||||
|
||||
##########################################################################
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user