summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authorMatt Valentine-House <matt@eightbitraptor.com>2023-11-30 11:05:26 +0000
committerMatt Valentine-House <matt@eightbitraptor.com>2023-11-30 21:31:57 +0000
commit57782d3d47bcb52af0006ac75e75f3b3609b1d31 (patch)
tree1ba2ddd9c6c0ecfec1f7b557eb680ebd1616317d /test/ruby
parenta1647c460f253cbf2c988f5f8bcf43bf23f576be (diff)
Store depth offset inside the scope node.
Instead of incrementing the depth using call by reference as we're recursing up the stack we could instead store an offset for each known scope where we know the depth is going to represented differently in the Prism ast.
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_compile_prism.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/ruby/test_compile_prism.rb b/test/ruby/test_compile_prism.rb
index 63b06bc9bd..1f0bce2037 100644
--- a/test/ruby/test_compile_prism.rb
+++ b/test/ruby/test_compile_prism.rb
@@ -737,6 +737,16 @@ module Prism
end
a + b + c
CODE
+ assert_prism_eval(<<~CODE)
+ foo = 1
+ begin
+ ensure
+ begin
+ ensure
+ foo.nil?
+ end
+ end
+ CODE
end
def test_NextNode