From 509b577e0126d92f37ae45d83863c449f8666be1 Mon Sep 17 00:00:00 2001 From: ydah Date: Tue, 24 Sep 2024 14:49:00 +0900 Subject: Implement BLOCK_PASS NODE keyword locations --- test/ruby/test_ast.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_ast.rb b/test/ruby/test_ast.rb index 38c0d56a0f..940c4de9d7 100644 --- a/test/ruby/test_ast.rb +++ b/test/ruby/test_ast.rb @@ -1348,6 +1348,14 @@ dummy assert_locations(node.children[-1].locations, [[1, 0, 1, 6], [1, 2, 1, 4]]) end + def test_block_pass_locations + node = ast_parse("foo(&bar)") + assert_locations(node.children[-1].children[-1].locations, [[1, 4, 1, 8], [1, 4, 1, 5]]) + + node = ast_parse("def a(&); b(&) end") + assert_locations(node.children[-1].children[-1].children[-1].children[-1].children[-1].locations, [[1, 12, 1, 13], [1, 12, 1, 13]]) + end + def test_break_locations node = ast_parse("loop { break 1 }") assert_locations(node.children[-1].children[-1].children[-1].locations, [[1, 7, 1, 14], [1, 7, 1, 12]]) -- cgit v1.2.3