[ruby/prism] Assume eval context for ruby_parser and ripper

e4d6984892
This commit is contained in:
Kevin Newton 2024-05-03 08:53:24 -04:00 committed by git
parent 32b1dea566
commit 1d51e929b1
2 changed files with 7 additions and 3 deletions

View file

@ -1536,13 +1536,13 @@ module Prism
# Parse the given source and translate it into the seattlerb/ruby_parser
# gem's Sexp format.
def parse(source, filepath = "(string)")
translate(Prism.parse(source, filepath: filepath), filepath)
translate(Prism.parse(source, filepath: filepath, scopes: [[]]), filepath)
end
# Parse the given file and translate it into the seattlerb/ruby_parser
# gem's Sexp format.
def parse_file(filepath)
translate(Prism.parse_file(filepath), filepath)
translate(Prism.parse_file(filepath, scopes: [[]]), filepath)
end
class << self