From c970d2941d56a862bb9bb3b808cb588c2982f436 Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Mon, 15 Dec 2025 21:46:17 +0100 Subject: [Bug #21784] Fix the Proc#source_location start_column for stabby lambdas * Consistent with plain `blocks` and `for` blocks and methods where the source_location covers their entire definition. * Matches the documentation which mentions "where the definition starts/ends". * Partially reverts d357d50f0a74409446f4cccec78593373f5adf2f which was a workaround to be compatible with parse.y. --- test/ruby/test_ast.rb | 2 +- test/ruby/test_lambda.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'test/ruby') diff --git a/test/ruby/test_ast.rb b/test/ruby/test_ast.rb index c7a946dec8..22ccbfb604 100644 --- a/test/ruby/test_ast.rb +++ b/test/ruby/test_ast.rb @@ -1230,7 +1230,7 @@ dummy args: nil body: (LAMBDA@1:0-2:3 - (SCOPE@1:2-2:3 + (SCOPE@1:0-2:3 tbl: [] args: (ARGS@1:2-1:2 diff --git a/test/ruby/test_lambda.rb b/test/ruby/test_lambda.rb index 3cbb54306c..6a0dd9915e 100644 --- a/test/ruby/test_lambda.rb +++ b/test/ruby/test_lambda.rb @@ -276,7 +276,7 @@ class TestLambdaParameters < Test::Unit::TestCase end def test_do_lambda_source_location - exp = [__LINE__ + 1, 12, __LINE__ + 5, 7] + exp = [__LINE__ + 1, 10, __LINE__ + 5, 7] lmd = ->(x, y, z) do @@ -288,7 +288,7 @@ class TestLambdaParameters < Test::Unit::TestCase end def test_brace_lambda_source_location - exp = [__LINE__ + 1, 12, __LINE__ + 5, 5] + exp = [__LINE__ + 1, 10, __LINE__ + 5, 5] lmd = ->(x, y, z) { -- cgit v1.2.3