Skip to content

Commit dee383b

Browse files
kddnewtonmatzbot
authored andcommitted
[ruby/yarp] Constants on classes and modules
(ruby/prism#1409) ruby/prism@0a11ec579f
1 parent 1d4d9a0 commit dee383b

30 files changed

Lines changed: 87 additions & 87 deletions

test/yarp/errors_test.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ def test_module_name_recoverable
1919
Location(),
2020
ConstantReadNode(:Parent),
2121
StatementsNode(
22-
[ModuleNode([], Location(), MissingNode(), nil, Location(), "", :"")]
22+
[ModuleNode([], Location(), MissingNode(), nil, Location(), :"", :"")]
2323
),
2424
Location(),
25-
"Parent",
25+
:Parent,
2626
:Parent
2727
)
2828

@@ -394,7 +394,7 @@ def test_module_definition_in_method_body
394394
Location(),
395395
nil,
396396
nil,
397-
StatementsNode([ModuleNode([], Location(), ConstantReadNode(:A), nil, Location(), "A", :A)]),
397+
StatementsNode([ModuleNode([], Location(), ConstantReadNode(:A), nil, Location(), :A, :A)]),
398398
[],
399399
Location(),
400400
nil,
@@ -425,7 +425,7 @@ def test_module_definition_in_method_body_within_block
425425
BlockNode(
426426
[],
427427
nil,
428-
StatementsNode([ModuleNode([], Location(), ConstantReadNode(:Foo), nil, Location(), "Foo", :Foo)]),
428+
StatementsNode([ModuleNode([], Location(), ConstantReadNode(:Foo), nil, Location(), :Foo, :Foo)]),
429429
Location(),
430430
Location()
431431
),
@@ -465,7 +465,7 @@ def test_class_definition_in_method_body
465465
nil,
466466
nil,
467467
Location(),
468-
"A",
468+
:A,
469469
:A
470470
)]
471471
),
@@ -981,7 +981,7 @@ def test_dont_allow_return_inside_class_body
981981
nil,
982982
StatementsNode([ReturnNode(Location(), nil)]),
983983
Location(),
984-
"A",
984+
:A,
985985
:A
986986
)
987987

@@ -997,7 +997,7 @@ def test_dont_allow_return_inside_module_body
997997
ConstantReadNode(:A),
998998
StatementsNode([ReturnNode(Location(), nil)]),
999999
Location(),
1000-
"A",
1000+
:A,
10011001
:A
10021002
)
10031003

test/yarp/snapshots/classes.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ ProgramNode(0...370)(
1717
)]
1818
),
1919
(14...17),
20-
"A",
20+
:A,
2121
:A
2222
),
2323
ClassNode(19...39)(
@@ -35,7 +35,7 @@ ProgramNode(0...370)(
3535
(36...39)
3636
),
3737
(36...39),
38-
"A",
38+
:A,
3939
:A
4040
),
4141
ClassNode(41...75)(
@@ -53,7 +53,7 @@ ProgramNode(0...370)(
5353
(72...75)
5454
),
5555
(72...75),
56-
"A",
56+
:A,
5757
:A
5858
),
5959
ClassNode(77...98)(
@@ -72,7 +72,7 @@ ProgramNode(0...370)(
7272
)]
7373
),
7474
(95...98),
75-
"A",
75+
:A,
7676
:A
7777
),
7878
SingletonClassNode(100...120)(
@@ -127,7 +127,7 @@ ProgramNode(0...370)(
127127
)]
128128
),
129129
(159...162),
130-
"A",
130+
:A,
131131
:A
132132
),
133133
ClassNode(164...218)(
@@ -154,7 +154,7 @@ ProgramNode(0...370)(
154154
)]
155155
),
156156
(215...218),
157-
"A",
157+
:A,
158158
:A
159159
),
160160
SingletonClassNode(220...240)(
@@ -287,7 +287,7 @@ ProgramNode(0...370)(
287287
),
288288
nil,
289289
(367...370),
290-
"A",
290+
:A,
291291
:A
292292
)]
293293
)

test/yarp/snapshots/method_calls.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1192,7 +1192,7 @@ ProgramNode(0...1237)(
11921192
)]
11931193
),
11941194
(926...929),
1195-
"Bar",
1195+
:Bar,
11961196
:Bar
11971197
)]
11981198
),
@@ -1225,7 +1225,7 @@ ProgramNode(0...1237)(
12251225
)]
12261226
),
12271227
(957...960),
1228-
"Bar",
1228+
:Bar,
12291229
:Bar
12301230
)]
12311231
),

test/yarp/snapshots/modules.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ ProgramNode(0...140)(
1515
)]
1616
),
1717
(15...18),
18-
"A",
18+
:A,
1919
:A
2020
),
2121
InterpolatedStringNode(20...38)(
@@ -51,7 +51,7 @@ ProgramNode(0...140)(
5151
),
5252
nil,
5353
(52...55),
54-
"M",
54+
:M,
5555
:M
5656
),
5757
ModuleNode(57...85)(
@@ -75,7 +75,7 @@ ProgramNode(0...140)(
7575
(82...85)
7676
),
7777
(82...85),
78-
"A",
78+
:A,
7979
:A
8080
),
8181
ModuleNode(87...101)(
@@ -88,7 +88,7 @@ ProgramNode(0...140)(
8888
),
8989
nil,
9090
(98...101),
91-
"A",
91+
:A,
9292
:A
9393
),
9494
ModuleNode(103...120)(
@@ -111,7 +111,7 @@ ProgramNode(0...140)(
111111
),
112112
nil,
113113
(117...120),
114-
"B",
114+
:B,
115115
:B
116116
),
117117
ModuleNode(122...140)(
@@ -134,7 +134,7 @@ ProgramNode(0...140)(
134134
),
135135
nil,
136136
(137...140),
137-
"B",
137+
:B,
138138
:B
139139
)]
140140
)

test/yarp/snapshots/seattlerb/TestRubyParserShared.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ ProgramNode(0...689)(
8787
)]
8888
),
8989
(266...269),
90-
"X",
90+
:X,
9191
:X
9292
),
9393
ClassNode(293...376)(
@@ -112,12 +112,12 @@ ProgramNode(0...689)(
112112
)]
113113
),
114114
(355...358),
115-
"Y",
115+
:Y,
116116
:Y
117117
)]
118118
),
119119
(373...376),
120-
"X",
120+
:X,
121121
:X
122122
),
123123
ClassNode(395...498)(
@@ -165,7 +165,7 @@ ProgramNode(0...689)(
165165
)]
166166
),
167167
(495...498),
168-
"X",
168+
:X,
169169
:X
170170
),
171171
ModuleNode(517...565)(
@@ -186,7 +186,7 @@ ProgramNode(0...689)(
186186
)]
187187
),
188188
(562...565),
189-
"X",
189+
:X,
190190
:X
191191
),
192192
ModuleNode(568...651)(
@@ -207,12 +207,12 @@ ProgramNode(0...689)(
207207
)]
208208
),
209209
(630...633),
210-
"Y",
210+
:Y,
211211
:Y
212212
)]
213213
),
214214
(648...651),
215-
"X",
215+
:X,
216216
:X
217217
),
218218
CallNode(670...689)(

test/yarp/snapshots/seattlerb/class_comments.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ ProgramNode(19...71)(
2323
)]
2424
),
2525
(68...71),
26-
"X",
26+
:X,
2727
:X
2828
)]
2929
)

test/yarp/snapshots/seattlerb/defn_oneliner_eq2.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ ProgramNode(0...28)(
3131
)]
3232
),
3333
(25...28),
34-
"X",
34+
:X,
3535
:X
3636
)]
3737
)

test/yarp/snapshots/seattlerb/defs_oneliner_eq2.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ ProgramNode(0...33)(
3131
)]
3232
),
3333
(30...33),
34-
"X",
34+
:X,
3535
:X
3636
)]
3737
)

test/yarp/snapshots/seattlerb/magic_encoding_comment.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ ProgramNode(18...90)(
3131
)]
3232
),
3333
(87...90),
34-
"ExampleUTF8ClassNameVarietà",
34+
:ExampleUTF8ClassNameVarietà,
3535
:ExampleUTF8ClassNameVarietà
3636
)]
3737
)

test/yarp/snapshots/seattlerb/module_comments.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ ProgramNode(24...77)(
2121
)]
2222
),
2323
(74...77),
24-
"X",
24+
:X,
2525
:X
2626
)]
2727
)

0 commit comments

Comments
 (0)