Skip to content

Commit

Permalink
[ruby/yarp] Constants on classes and modules
Browse files Browse the repository at this point in the history
  • Loading branch information
kddnewton authored and matzbot committed Sep 6, 2023
1 parent 1d4d9a0 commit dee383b
Show file tree
Hide file tree
Showing 30 changed files with 87 additions and 87 deletions.
14 changes: 7 additions & 7 deletions test/yarp/errors_test.rb
Expand Up @@ -19,10 +19,10 @@ def test_module_name_recoverable
Location(),
ConstantReadNode(:Parent),
StatementsNode(
[ModuleNode([], Location(), MissingNode(), nil, Location(), "", :"")]
[ModuleNode([], Location(), MissingNode(), nil, Location(), :"", :"")]
),
Location(),
"Parent",
:Parent,
:Parent
)

Expand Down Expand Up @@ -394,7 +394,7 @@ def test_module_definition_in_method_body
Location(),
nil,
nil,
StatementsNode([ModuleNode([], Location(), ConstantReadNode(:A), nil, Location(), "A", :A)]),
StatementsNode([ModuleNode([], Location(), ConstantReadNode(:A), nil, Location(), :A, :A)]),
[],
Location(),
nil,
Expand Down Expand Up @@ -425,7 +425,7 @@ def test_module_definition_in_method_body_within_block
BlockNode(
[],
nil,
StatementsNode([ModuleNode([], Location(), ConstantReadNode(:Foo), nil, Location(), "Foo", :Foo)]),
StatementsNode([ModuleNode([], Location(), ConstantReadNode(:Foo), nil, Location(), :Foo, :Foo)]),
Location(),
Location()
),
Expand Down Expand Up @@ -465,7 +465,7 @@ def test_class_definition_in_method_body
nil,
nil,
Location(),
"A",
:A,
:A
)]
),
Expand Down Expand Up @@ -981,7 +981,7 @@ def test_dont_allow_return_inside_class_body
nil,
StatementsNode([ReturnNode(Location(), nil)]),
Location(),
"A",
:A,
:A
)

Expand All @@ -997,7 +997,7 @@ def test_dont_allow_return_inside_module_body
ConstantReadNode(:A),
StatementsNode([ReturnNode(Location(), nil)]),
Location(),
"A",
:A,
:A
)

Expand Down
14 changes: 7 additions & 7 deletions test/yarp/snapshots/classes.txt
Expand Up @@ -17,7 +17,7 @@ ProgramNode(0...370)(
)]
),
(14...17),
"A",
:A,
:A
),
ClassNode(19...39)(
Expand All @@ -35,7 +35,7 @@ ProgramNode(0...370)(
(36...39)
),
(36...39),
"A",
:A,
:A
),
ClassNode(41...75)(
Expand All @@ -53,7 +53,7 @@ ProgramNode(0...370)(
(72...75)
),
(72...75),
"A",
:A,
:A
),
ClassNode(77...98)(
Expand All @@ -72,7 +72,7 @@ ProgramNode(0...370)(
)]
),
(95...98),
"A",
:A,
:A
),
SingletonClassNode(100...120)(
Expand Down Expand Up @@ -127,7 +127,7 @@ ProgramNode(0...370)(
)]
),
(159...162),
"A",
:A,
:A
),
ClassNode(164...218)(
Expand All @@ -154,7 +154,7 @@ ProgramNode(0...370)(
)]
),
(215...218),
"A",
:A,
:A
),
SingletonClassNode(220...240)(
Expand Down Expand Up @@ -287,7 +287,7 @@ ProgramNode(0...370)(
),
nil,
(367...370),
"A",
:A,
:A
)]
)
Expand Down
4 changes: 2 additions & 2 deletions test/yarp/snapshots/method_calls.txt
Expand Up @@ -1192,7 +1192,7 @@ ProgramNode(0...1237)(
)]
),
(926...929),
"Bar",
:Bar,
:Bar
)]
),
Expand Down Expand Up @@ -1225,7 +1225,7 @@ ProgramNode(0...1237)(
)]
),
(957...960),
"Bar",
:Bar,
:Bar
)]
),
Expand Down
12 changes: 6 additions & 6 deletions test/yarp/snapshots/modules.txt
Expand Up @@ -15,7 +15,7 @@ ProgramNode(0...140)(
)]
),
(15...18),
"A",
:A,
:A
),
InterpolatedStringNode(20...38)(
Expand Down Expand Up @@ -51,7 +51,7 @@ ProgramNode(0...140)(
),
nil,
(52...55),
"M",
:M,
:M
),
ModuleNode(57...85)(
Expand All @@ -75,7 +75,7 @@ ProgramNode(0...140)(
(82...85)
),
(82...85),
"A",
:A,
:A
),
ModuleNode(87...101)(
Expand All @@ -88,7 +88,7 @@ ProgramNode(0...140)(
),
nil,
(98...101),
"A",
:A,
:A
),
ModuleNode(103...120)(
Expand All @@ -111,7 +111,7 @@ ProgramNode(0...140)(
),
nil,
(117...120),
"B",
:B,
:B
),
ModuleNode(122...140)(
Expand All @@ -134,7 +134,7 @@ ProgramNode(0...140)(
),
nil,
(137...140),
"B",
:B,
:B
)]
)
Expand Down
14 changes: 7 additions & 7 deletions test/yarp/snapshots/seattlerb/TestRubyParserShared.txt
Expand Up @@ -87,7 +87,7 @@ ProgramNode(0...689)(
)]
),
(266...269),
"X",
:X,
:X
),
ClassNode(293...376)(
Expand All @@ -112,12 +112,12 @@ ProgramNode(0...689)(
)]
),
(355...358),
"Y",
:Y,
:Y
)]
),
(373...376),
"X",
:X,
:X
),
ClassNode(395...498)(
Expand Down Expand Up @@ -165,7 +165,7 @@ ProgramNode(0...689)(
)]
),
(495...498),
"X",
:X,
:X
),
ModuleNode(517...565)(
Expand All @@ -186,7 +186,7 @@ ProgramNode(0...689)(
)]
),
(562...565),
"X",
:X,
:X
),
ModuleNode(568...651)(
Expand All @@ -207,12 +207,12 @@ ProgramNode(0...689)(
)]
),
(630...633),
"Y",
:Y,
:Y
)]
),
(648...651),
"X",
:X,
:X
),
CallNode(670...689)(
Expand Down
2 changes: 1 addition & 1 deletion test/yarp/snapshots/seattlerb/class_comments.txt
Expand Up @@ -23,7 +23,7 @@ ProgramNode(19...71)(
)]
),
(68...71),
"X",
:X,
:X
)]
)
Expand Down
2 changes: 1 addition & 1 deletion test/yarp/snapshots/seattlerb/defn_oneliner_eq2.txt
Expand Up @@ -31,7 +31,7 @@ ProgramNode(0...28)(
)]
),
(25...28),
"X",
:X,
:X
)]
)
Expand Down
2 changes: 1 addition & 1 deletion test/yarp/snapshots/seattlerb/defs_oneliner_eq2.txt
Expand Up @@ -31,7 +31,7 @@ ProgramNode(0...33)(
)]
),
(30...33),
"X",
:X,
:X
)]
)
Expand Down
2 changes: 1 addition & 1 deletion test/yarp/snapshots/seattlerb/magic_encoding_comment.txt
Expand Up @@ -31,7 +31,7 @@ ProgramNode(18...90)(
)]
),
(87...90),
"ExampleUTF8ClassNameVarietà",
:ExampleUTF8ClassNameVarietà,
:ExampleUTF8ClassNameVarietà
)]
)
Expand Down
2 changes: 1 addition & 1 deletion test/yarp/snapshots/seattlerb/module_comments.txt
Expand Up @@ -21,7 +21,7 @@ ProgramNode(24...77)(
)]
),
(74...77),
"X",
:X,
:X
)]
)
Expand Down
Expand Up @@ -19,7 +19,7 @@ ProgramNode(0...48)(
nil,
nil,
(45...48),
"Foo",
:Foo,
:Foo
)]
)
Expand Down
16 changes: 8 additions & 8 deletions test/yarp/snapshots/unparser/corpus/literal/class.txt
Expand Up @@ -9,7 +9,7 @@ ProgramNode(0...213)(
nil,
nil,
(8...11),
"A",
:A,
:A
),
SingletonClassNode(13...27)(
Expand Down Expand Up @@ -42,7 +42,7 @@ ProgramNode(0...213)(
nil,
nil,
(60...63),
"B",
:B,
:B
),
ClassNode(65...82)(
Expand All @@ -61,7 +61,7 @@ ProgramNode(0...213)(
nil,
nil,
(79...82),
"C",
:C,
:C
),
ClassNode(84...99)(
Expand All @@ -72,7 +72,7 @@ ProgramNode(0...213)(
ConstantReadNode(94...95)(:B),
nil,
(96...99),
"A",
:A,
:A
),
ClassNode(101...119)(
Expand All @@ -87,7 +87,7 @@ ProgramNode(0...213)(
),
nil,
(116...119),
"A",
:A,
:A
),
ClassNode(121...142)(
Expand All @@ -106,7 +106,7 @@ ProgramNode(0...213)(
),
nil,
(139...142),
"B",
:B,
:B
),
ClassNode(144...198)(
Expand Down Expand Up @@ -156,7 +156,7 @@ ProgramNode(0...213)(
)]
),
(195...198),
"A",
:A,
:A
),
ClassNode(200...213)(
Expand All @@ -171,7 +171,7 @@ ProgramNode(0...213)(
nil,
nil,
(210...213),
"A",
:A,
:A
)]
)
Expand Down
4 changes: 2 additions & 2 deletions test/yarp/snapshots/unparser/corpus/literal/if.txt
Expand Up @@ -81,7 +81,7 @@ ProgramNode(0...246)(
)]
),
(130...133),
"A",
:A,
:A
),
ModuleNode(135...170)(
Expand Down Expand Up @@ -116,7 +116,7 @@ ProgramNode(0...246)(
)]
),
(167...170),
"B",
:B,
:B
),
UnlessNode(171...197)(
Expand Down

0 comments on commit dee383b

Please sign in to comment.