Skip to content

Commit 746eede

Browse files
kddnewtonmatzbot
authored andcommitted
[ruby/yarp] Constant on block parameter node
ruby/prism@2cd9a67150
1 parent 08929b3 commit 746eede

33 files changed

+119
-76
lines changed

test/yarp/errors_test.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,7 @@ def test_method_parameters_after_block
644644
nil,
645645
[],
646646
nil,
647-
BlockParameterNode(Location(), Location())
647+
BlockParameterNode(:block, Location(), Location())
648648
),
649649
nil,
650650
[:block, :a],
@@ -664,7 +664,7 @@ def test_method_with_arguments_after_anonymous_block
664664
expected = DefNode(
665665
Location(),
666666
nil,
667-
ParametersNode([], [], [RequiredParameterNode(:a)], nil, [], nil, BlockParameterNode(nil, Location())),
667+
ParametersNode([], [], [RequiredParameterNode(:a)], nil, [], nil, BlockParameterNode(nil, nil, Location())),
668668
nil,
669669
[:&, :a],
670670
Location(),
@@ -1087,7 +1087,7 @@ def test_duplicated_parameter_names
10871087
expected = DefNode(
10881088
Location(),
10891089
nil,
1090-
ParametersNode([RequiredParameterNode(:a), RequiredParameterNode(:b)], [], [], nil, [], nil, BlockParameterNode(Location(), Location())),
1090+
ParametersNode([RequiredParameterNode(:a), RequiredParameterNode(:b)], [], [], nil, [], nil, BlockParameterNode(:a, Location(), Location())),
10911091
nil,
10921092
[:a, :b],
10931093
Location(),

test/yarp/snapshots/methods.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -876,7 +876,7 @@ ProgramNode(0...1194)(
876876
nil,
877877
[],
878878
nil,
879-
BlockParameterNode(789...791)((790...791), (789...790))
879+
BlockParameterNode(789...791)(:b, (790...791), (789...790))
880880
),
881881
nil,
882882
[:b],
@@ -897,7 +897,7 @@ ProgramNode(0...1194)(
897897
nil,
898898
[],
899899
nil,
900-
BlockParameterNode(803...804)(nil, (803...804))
900+
BlockParameterNode(803...804)(nil, nil, (803...804))
901901
),
902902
nil,
903903
[:&],

test/yarp/snapshots/procs.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ ProgramNode(0...266)(
9393
[KeywordParameterNode(113...115)((113...115), nil),
9494
KeywordParameterNode(117...119)((117...119), nil)],
9595
nil,
96-
BlockParameterNode(121...123)((122...123), (121...122))
96+
BlockParameterNode(121...123)(:e, (122...123), (121...122))
9797
),
9898
[],
9999
nil,
@@ -120,7 +120,7 @@ ProgramNode(0...266)(
120120
[KeywordParameterNode(149...151)((149...151), nil),
121121
KeywordParameterNode(153...155)((153...155), nil)],
122122
KeywordRestParameterNode(157...160)((157...159), (159...160)),
123-
BlockParameterNode(162...164)((163...164), (162...163))
123+
BlockParameterNode(162...164)(:g, (163...164), (162...163))
124124
),
125125
[],
126126
(134...135),
@@ -147,7 +147,7 @@ ProgramNode(0...266)(
147147
[KeywordParameterNode(191...193)((191...193), nil),
148148
KeywordParameterNode(195...197)((195...197), nil)],
149149
KeywordRestParameterNode(199...202)((199...201), (201...202)),
150-
BlockParameterNode(204...206)((205...206), (204...205))
150+
BlockParameterNode(204...206)(:g, (205...206), (204...205))
151151
),
152152
[],
153153
(176...177),

test/yarp/snapshots/seattlerb/args_kw_block.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ ProgramNode(0...20)(
1111
nil,
1212
[KeywordParameterNode(6...10)((6...8), IntegerNode(9...10)())],
1313
nil,
14-
BlockParameterNode(12...14)((13...14), (12...13))
14+
BlockParameterNode(12...14)(:b, (13...14), (12...13))
1515
),
1616
nil,
1717
[:a, :b],

test/yarp/snapshots/seattlerb/block_arg__bare.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ ProgramNode(0...13)(
1111
nil,
1212
[],
1313
nil,
14-
BlockParameterNode(6...7)(nil, (6...7))
14+
BlockParameterNode(6...7)(nil, nil, (6...7))
1515
),
1616
nil,
1717
[:&],

test/yarp/snapshots/seattlerb/block_arg_opt_arg_block.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ ProgramNode(0...21)(
2323
nil,
2424
[],
2525
nil,
26-
BlockParameterNode(16...18)((17...18), (16...17))
26+
BlockParameterNode(16...18)(:e, (17...18), (16...17))
2727
),
2828
[],
2929
(4...5),

test/yarp/snapshots/seattlerb/block_arg_opt_splat_arg_block_omfg.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ ProgramNode(0...25)(
2323
RestParameterNode(13...15)((13...14), (14...15)),
2424
[],
2525
nil,
26-
BlockParameterNode(20...22)((21...22), (20...21))
26+
BlockParameterNode(20...22)(:f, (21...22), (20...21))
2727
),
2828
[],
2929
(4...5),

test/yarp/snapshots/seattlerb/block_args_opt3.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ ProgramNode(0...42)(
2929
nil,
3030
[],
3131
nil,
32-
BlockParameterNode(24...26)((25...26), (24...25))
32+
BlockParameterNode(24...26)(:d, (25...26), (24...25))
3333
),
3434
[],
3535
(4...5),

test/yarp/snapshots/seattlerb/block_opt_splat_arg_block_omfg.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ ProgramNode(0...22)(
2323
RestParameterNode(10...12)((10...11), (11...12)),
2424
[],
2525
nil,
26-
BlockParameterNode(17...19)((18...19), (17...18))
26+
BlockParameterNode(17...19)(:e, (18...19), (17...18))
2727
),
2828
[],
2929
(4...5),

test/yarp/snapshots/seattlerb/difficult3_3.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ ProgramNode(0...17)(
1818
RestParameterNode(5...7)((5...6), (6...7)),
1919
[],
2020
nil,
21-
BlockParameterNode(12...14)((13...14), (12...13))
21+
BlockParameterNode(12...14)(:c, (13...14), (12...13))
2222
),
2323
[],
2424
(4...5),

0 commit comments

Comments
 (0)