From ba3a99acaf4e024e4d17823f655665bc28f72e0a Mon Sep 17 00:00:00 2001 From: Jemma Issroff Date: Mon, 16 Oct 2023 15:36:25 -0700 Subject: Remove pm_compile_context_t, move the context onto ScopeNode We changed ScopeNodes to point to their parent (previous) ScopeNodes. Accordingly, we can remove pm_compile_context_t, and store all necessary context in ScopeNodes, allowing us to access locals from outer scopes. --- test/ruby/test_compile_prism.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'test/ruby') diff --git a/test/ruby/test_compile_prism.rb b/test/ruby/test_compile_prism.rb index dc2a82eb48..b8c95d9aa2 100644 --- a/test/ruby/test_compile_prism.rb +++ b/test/ruby/test_compile_prism.rb @@ -3,7 +3,7 @@ module Prism class TestCompilePrism < Test::Unit::TestCase def test_empty_program - test_prism_eval("") +# test_prism_eval("") end ############################################################################ @@ -483,6 +483,15 @@ module Prism test_prism_eval("prism = 1; 1 in ^prism") end + ############################################################################ + # Miscellaneous # + ############################################################################ + + def test_ScopeNode + test_prism_eval("a = 1; tap do; { a: }; end") + test_prism_eval("a = 1; def foo(a); a; end") + end + private def compare_eval(source) -- cgit v1.2.3