diff options
author | Kevin Newton <kddnewton@gmail.com> | 2024-05-03 08:53:24 -0400 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2024-05-03 13:12:27 +0000 |
commit | 1d51e929b1b10fe9fa109f8a8ebc3b938827271c (patch) | |
tree | 80172ab030813c208689e798be026afd9dc4060b /lib/prism/translation/ripper.rb | |
parent | 32b1dea5665a6d1cf82e39af7bffb48172399205 (diff) |
[ruby/prism] Assume eval context for ruby_parser and ripper
https://github.com/ruby/prism/commit/e4d6984892
Diffstat (limited to 'lib/prism/translation/ripper.rb')
-rw-r--r-- | lib/prism/translation/ripper.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/prism/translation/ripper.rb b/lib/prism/translation/ripper.rb index 2c5e4569c2..4e3b1b74fd 100644 --- a/lib/prism/translation/ripper.rb +++ b/lib/prism/translation/ripper.rb @@ -3267,7 +3267,11 @@ module Prism # Lazily initialize the parse result. def result - @result ||= Prism.parse(source) + @result ||= + begin + scopes = RUBY_VERSION >= "3.3.0" ? [] : [[]] + Prism.parse(source, scopes: scopes) + end end ########################################################################## |