diff options
| author | Benoit Daloze <eregontp@gmail.com> | 2025-12-15 21:46:17 +0100 |
|---|---|---|
| committer | Benoit Daloze <eregontp@gmail.com> | 2025-12-30 16:02:39 +0100 |
| commit | c970d2941d56a862bb9bb3b808cb588c2982f436 (patch) | |
| tree | 11d706a9fcf13c88baa6e0b182f394f0b678f385 /test | |
| parent | cd66d15858a06406d1de854f3e9690d3557a9864 (diff) | |
[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.
Diffstat (limited to 'test')
| -rw-r--r-- | test/ruby/test_ast.rb | 2 | ||||
| -rw-r--r-- | test/ruby/test_lambda.rb | 4 |
2 files changed, 3 insertions, 3 deletions
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) { |
