From 0176b9310d22b801d046da01d7d9330655d2f0e8 Mon Sep 17 00:00:00 2001 From: Richard Feldman Date: Thu, 10 Aug 2023 21:51:01 -0400 Subject: [PATCH] Update snapshot tests --- ...lity_demand_value_has_args.expr.result-ast | 2 +- ...ds_not_indented_with_first.expr.result-ast | 2 +- ...demand_not_indented_enough.expr.result-ast | 2 +- ...y_non_signature_expression.expr.result-ast | 2 +- ...and_signature_is_multiline.expr.result-ast | 14 +- .../pass/ability_multi_line.expr.result-ast | 22 +- .../pass/ability_single_line.expr.result-ast | 22 +- .../pass/ability_two_in_a_row.expr.result-ast | 44 ++-- .../opaque_has_abilities.expr.formatted.roc | 8 +- .../pass/opaque_has_abilities.expr.result-ast | 224 +++++++++--------- .../where_clause_function.expr.result-ast | 12 +- ...e_multiple_bound_abilities.expr.result-ast | 54 ++--- .../where_clause_multiple_has.expr.result-ast | 24 +- ...ple_has_across_newlines.expr.formatted.roc | 2 +- ...ltiple_has_across_newlines.expr.result-ast | 24 +- .../where_clause_non_function.expr.result-ast | 12 +- .../where_clause_on_newline.expr.result-ast | 12 +- 17 files changed, 241 insertions(+), 241 deletions(-) diff --git a/crates/compiler/test_syntax/tests/snapshots/fail/ability_demand_value_has_args.expr.result-ast b/crates/compiler/test_syntax/tests/snapshots/fail/ability_demand_value_has_args.expr.result-ast index 3cb44e1fdf..1e781bb579 100644 --- a/crates/compiler/test_syntax/tests/snapshots/fail/ability_demand_value_has_args.expr.result-ast +++ b/crates/compiler/test_syntax/tests/snapshots/fail/ability_demand_value_has_args.expr.result-ast @@ -1 +1 @@ -Expr(Ability(DemandColon(@15), @7), @0) \ No newline at end of file +Expr(Ability(DemandColon(@22), @14), @0) \ No newline at end of file diff --git a/crates/compiler/test_syntax/tests/snapshots/fail/ability_demands_not_indented_with_first.expr.result-ast b/crates/compiler/test_syntax/tests/snapshots/fail/ability_demands_not_indented_with_first.expr.result-ast index b4df5acd38..4d5187ee9f 100644 --- a/crates/compiler/test_syntax/tests/snapshots/fail/ability_demands_not_indented_with_first.expr.result-ast +++ b/crates/compiler/test_syntax/tests/snapshots/fail/ability_demands_not_indented_with_first.expr.result-ast @@ -1 +1 @@ -Expr(Ability(DemandAlignment(4, @49), @40), @0) \ No newline at end of file +Expr(Ability(DemandAlignment(4, @67), @58), @0) \ No newline at end of file diff --git a/crates/compiler/test_syntax/tests/snapshots/fail/ability_first_demand_not_indented_enough.expr.result-ast b/crates/compiler/test_syntax/tests/snapshots/fail/ability_first_demand_not_indented_enough.expr.result-ast index f069010c69..d3fb65ba18 100644 --- a/crates/compiler/test_syntax/tests/snapshots/fail/ability_first_demand_not_indented_enough.expr.result-ast +++ b/crates/compiler/test_syntax/tests/snapshots/fail/ability_first_demand_not_indented_enough.expr.result-ast @@ -1 +1 @@ -Expr(Ability(DemandAlignment(-1, @8), @7), @0) \ No newline at end of file +Expr(Ability(DemandAlignment(-1, @15), @14), @0) \ No newline at end of file diff --git a/crates/compiler/test_syntax/tests/snapshots/fail/ability_non_signature_expression.expr.result-ast b/crates/compiler/test_syntax/tests/snapshots/fail/ability_non_signature_expression.expr.result-ast index a66a3a05e5..08763b5ffb 100644 --- a/crates/compiler/test_syntax/tests/snapshots/fail/ability_non_signature_expression.expr.result-ast +++ b/crates/compiler/test_syntax/tests/snapshots/fail/ability_non_signature_expression.expr.result-ast @@ -1 +1 @@ -Expr(Ability(DemandName(@12), @7), @0) \ No newline at end of file +Expr(Ability(DemandName(@19), @14), @0) \ No newline at end of file diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/ability_demand_signature_is_multiline.expr.result-ast b/crates/compiler/test_syntax/tests/snapshots/pass/ability_demand_signature_is_multiline.expr.result-ast index 7f97d78500..03168073e5 100644 --- a/crates/compiler/test_syntax/tests/snapshots/pass/ability_demand_signature_is_multiline.expr.result-ast +++ b/crates/compiler/test_syntax/tests/snapshots/pass/ability_demand_signature_is_multiline.expr.result-ast @@ -4,7 +4,7 @@ Defs( Index(0), ], regions: [ - @0-36, + @0-43, ], space_before: [ Slice(start = 0, length = 0), @@ -19,18 +19,18 @@ Defs( name: @0-4 "Hash", vars: [], }, - loc_has: @5-8 Has, + loc_implements: @5-15 Implements, members: [ AbilityMember { - name: @11-15 SpaceBefore( + name: @18-22 SpaceBefore( "hash", [ Newline, ], ), - typ: @18-36 Function( + typ: @25-43 Function( [ - @18-19 SpaceAfter( + @25-26 SpaceAfter( BoundVariable( "a", ), @@ -39,7 +39,7 @@ Defs( ], ), ], - @33-36 Apply( + @40-43 Apply( "", "U64", [], @@ -51,7 +51,7 @@ Defs( ], value_defs: [], }, - @38-39 SpaceBefore( + @45-46 SpaceBefore( Num( "1", ), diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/ability_multi_line.expr.result-ast b/crates/compiler/test_syntax/tests/snapshots/pass/ability_multi_line.expr.result-ast index 35bbb58f04..9203211925 100644 --- a/crates/compiler/test_syntax/tests/snapshots/pass/ability_multi_line.expr.result-ast +++ b/crates/compiler/test_syntax/tests/snapshots/pass/ability_multi_line.expr.result-ast @@ -4,7 +4,7 @@ Defs( Index(0), ], regions: [ - @0-45, + @0-52, ], space_before: [ Slice(start = 0, length = 0), @@ -19,22 +19,22 @@ Defs( name: @0-4 "Hash", vars: [], }, - loc_has: @5-8 Has, + loc_implements: @5-15 Implements, members: [ AbilityMember { - name: @11-15 SpaceBefore( + name: @18-22 SpaceBefore( "hash", [ Newline, ], ), - typ: @18-26 Function( + typ: @25-33 Function( [ - @18-19 BoundVariable( + @25-26 BoundVariable( "a", ), ], - @23-26 Apply( + @30-33 Apply( "", "U64", [], @@ -42,19 +42,19 @@ Defs( ), }, AbilityMember { - name: @29-34 SpaceBefore( + name: @36-41 SpaceBefore( "hash2", [ Newline, ], ), - typ: @37-45 Function( + typ: @44-52 Function( [ - @37-38 BoundVariable( + @44-45 BoundVariable( "a", ), ], - @42-45 Apply( + @49-52 Apply( "", "U64", [], @@ -66,7 +66,7 @@ Defs( ], value_defs: [], }, - @47-48 SpaceBefore( + @54-55 SpaceBefore( Num( "1", ), diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/ability_single_line.expr.result-ast b/crates/compiler/test_syntax/tests/snapshots/pass/ability_single_line.expr.result-ast index e450865a13..2847f04b1d 100644 --- a/crates/compiler/test_syntax/tests/snapshots/pass/ability_single_line.expr.result-ast +++ b/crates/compiler/test_syntax/tests/snapshots/pass/ability_single_line.expr.result-ast @@ -4,7 +4,7 @@ Defs( Index(0), ], regions: [ - @0-37, + @0-55, ], space_before: [ Slice(start = 0, length = 0), @@ -19,28 +19,28 @@ Defs( name: @0-4 "Hash", vars: [], }, - loc_has: @5-8 Has, + loc_implements: @5-15 Implements, members: [ AbilityMember { - name: @9-13 "hash", - typ: @16-37 Where( - @16-24 Function( + name: @16-20 "hash", + typ: @23-55 Where( + @23-31 Function( [ - @16-17 BoundVariable( + @23-24 BoundVariable( "a", ), ], - @21-24 Apply( + @28-31 Apply( "", "U64", [], ), ), [ - @27-37 HasClause { - var: @27-28 "a", + @38-55 ImplementsClause { + var: @38-39 "a", abilities: [ - @33-37 Apply( + @51-55 Apply( "", "Hash", [], @@ -55,7 +55,7 @@ Defs( ], value_defs: [], }, - @39-40 SpaceBefore( + @57-58 SpaceBefore( Num( "1", ), diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/ability_two_in_a_row.expr.result-ast b/crates/compiler/test_syntax/tests/snapshots/pass/ability_two_in_a_row.expr.result-ast index cce2f989e2..d4285ec53d 100644 --- a/crates/compiler/test_syntax/tests/snapshots/pass/ability_two_in_a_row.expr.result-ast +++ b/crates/compiler/test_syntax/tests/snapshots/pass/ability_two_in_a_row.expr.result-ast @@ -5,8 +5,8 @@ Defs( Index(1), ], regions: [ - @0-33, - @35-68, + @0-51, + @53-104, ], space_before: [ Slice(start = 0, length = 0), @@ -26,27 +26,27 @@ Defs( name: @0-3 "Ab1", vars: [], }, - loc_has: @4-7 Has, + loc_implements: @4-14 Implements, members: [ AbilityMember { - name: @8-11 "ab1", - typ: @14-33 Where( - @14-21 Function( + name: @15-18 "ab1", + typ: @21-51 Where( + @21-28 Function( [ - @14-15 BoundVariable( + @21-22 BoundVariable( "a", ), ], - @19-21 Record { + @26-28 Record { fields: [], ext: None, }, ), [ - @24-33 HasClause { - var: @24-25 "a", + @35-51 ImplementsClause { + var: @35-36 "a", abilities: [ - @30-33 Apply( + @48-51 Apply( "", "Ab1", [], @@ -60,30 +60,30 @@ Defs( }, Ability { header: TypeHeader { - name: @35-38 "Ab2", + name: @53-56 "Ab2", vars: [], }, - loc_has: @39-42 Has, + loc_implements: @57-67 Implements, members: [ AbilityMember { - name: @43-46 "ab2", - typ: @49-68 Where( - @49-56 Function( + name: @68-71 "ab2", + typ: @74-104 Where( + @74-81 Function( [ - @49-50 BoundVariable( + @74-75 BoundVariable( "a", ), ], - @54-56 Record { + @79-81 Record { fields: [], ext: None, }, ), [ - @59-68 HasClause { - var: @59-60 "a", + @88-104 ImplementsClause { + var: @88-89 "a", abilities: [ - @65-68 Apply( + @101-104 Apply( "", "Ab2", [], @@ -98,7 +98,7 @@ Defs( ], value_defs: [], }, - @70-71 SpaceBefore( + @106-107 SpaceBefore( Num( "1", ), diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/opaque_has_abilities.expr.formatted.roc b/crates/compiler/test_syntax/tests/snapshots/pass/opaque_has_abilities.expr.formatted.roc index ce68feedbf..bc1b9655e7 100644 --- a/crates/compiler/test_syntax/tests/snapshots/pass/opaque_has_abilities.expr.formatted.roc +++ b/crates/compiler/test_syntax/tests/snapshots/pass/opaque_has_abilities.expr.formatted.roc @@ -1,10 +1,10 @@ A := U8 implements [Eq, Hash] A := a where a implements Other - implements [Eq, Hash] + implements [Eq, Hash] A := a where a implements Other - implements [Eq, Hash] + implements [Eq, Hash] A := U8 implements [Eq { eq }, Hash { hash }] @@ -17,8 +17,8 @@ A := U8 implements [Hash, Eq { eq, eq1 }] A := U8 implements [] A := a where a implements Other - implements [Eq { eq }, Hash { hash }] + implements [Eq { eq }, Hash { hash }] A := U8 implements [Eq {}] -0 +0 \ No newline at end of file diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/opaque_has_abilities.expr.result-ast b/crates/compiler/test_syntax/tests/snapshots/pass/opaque_has_abilities.expr.result-ast index b9a9bf4520..6426fd40e6 100644 --- a/crates/compiler/test_syntax/tests/snapshots/pass/opaque_has_abilities.expr.result-ast +++ b/crates/compiler/test_syntax/tests/snapshots/pass/opaque_has_abilities.expr.result-ast @@ -14,15 +14,15 @@ Defs( ], regions: [ @0-7, - @24-44, - @61-81, - @103-110, - @139-146, - @167-174, - @201-208, - @235-242, - @251-271, - @305-312, + @31-62, + @86-117, + @146-153, + @189-196, + @224-231, + @265-272, + @306-313, + @329-360, + @401-408, ], space_before: [ Slice(start = 0, length = 0), @@ -80,18 +80,18 @@ Defs( [], ), derived: Some( - @12-22 Has( + @19-29 Implements( [ - @13-15 HasAbility { - ability: @13-15 Apply( + @20-22 ImplementsAbility { + ability: @20-22 Apply( "", "Eq", [], ), impls: None, }, - @17-21 HasAbility { - ability: @17-21 Apply( + @24-28 ImplementsAbility { + ability: @24-28 Apply( "", "Hash", [], @@ -104,18 +104,18 @@ Defs( }, Opaque { header: TypeHeader { - name: @24-25 "A", + name: @31-32 "A", vars: [], }, - typ: @29-44 Where( - @29-30 BoundVariable( + typ: @36-62 Where( + @36-37 BoundVariable( "a", ), [ - @33-44 HasClause { - var: @33-34 "a", + @44-62 ImplementsClause { + var: @44-45 "a", abilities: [ - @39-44 Apply( + @57-62 Apply( "", "Other", [], @@ -125,18 +125,18 @@ Defs( ], ), derived: Some( - @49-59 Has( + @74-84 Implements( [ - @50-52 HasAbility { - ability: @50-52 Apply( + @75-77 ImplementsAbility { + ability: @75-77 Apply( "", "Eq", [], ), impls: None, }, - @54-58 HasAbility { - ability: @54-58 Apply( + @79-83 ImplementsAbility { + ability: @79-83 Apply( "", "Hash", [], @@ -149,18 +149,18 @@ Defs( }, Opaque { header: TypeHeader { - name: @61-62 "A", + name: @86-87 "A", vars: [], }, - typ: @66-81 Where( - @66-67 BoundVariable( + typ: @91-117 Where( + @91-92 BoundVariable( "a", ), [ - @70-81 HasClause { - var: @70-71 "a", + @99-117 ImplementsClause { + var: @99-100 "a", abilities: [ - @76-81 Apply( + @112-117 Apply( "", "Other", [], @@ -170,19 +170,19 @@ Defs( ], ), derived: Some( - @91-101 SpaceBefore( - Has( + @134-144 SpaceBefore( + Implements( [ - @92-94 HasAbility { - ability: @92-94 Apply( + @135-137 ImplementsAbility { + ability: @135-137 Apply( "", "Eq", [], ), impls: None, }, - @96-100 HasAbility { - ability: @96-100 Apply( + @139-143 ImplementsAbility { + ability: @139-143 Apply( "", "Hash", [], @@ -199,44 +199,44 @@ Defs( }, Opaque { header: TypeHeader { - name: @103-104 "A", + name: @146-147 "A", vars: [], }, - typ: @108-110 Apply( + typ: @151-153 Apply( "", "U8", [], ), derived: Some( - @115-137 Has( + @165-187 Implements( [ - @116-123 HasAbility { - ability: @116-118 Apply( + @166-173 ImplementsAbility { + ability: @166-168 Apply( "", "Eq", [], ), impls: Some( - @119-123 HasImpls( + @169-173 AbilityImpls( [ - @120-122 LabelOnly( - @120-122 "eq", + @170-172 LabelOnly( + @170-172 "eq", ), ], ), ), }, - @125-136 HasAbility { - ability: @125-129 Apply( + @175-186 ImplementsAbility { + ability: @175-179 Apply( "", "Hash", [], ), impls: Some( - @130-136 HasImpls( + @180-186 AbilityImpls( [ - @131-135 LabelOnly( - @131-135 "hash", + @181-185 LabelOnly( + @181-185 "hash", ), ], ), @@ -248,31 +248,31 @@ Defs( }, Opaque { header: TypeHeader { - name: @139-140 "A", + name: @189-190 "A", vars: [], }, - typ: @144-146 Apply( + typ: @194-196 Apply( "", "U8", [], ), derived: Some( - @151-165 Has( + @208-222 Implements( [ - @152-164 HasAbility { - ability: @152-154 Apply( + @209-221 ImplementsAbility { + ability: @209-211 Apply( "", "Eq", [], ), impls: Some( - @155-164 HasImpls( + @212-221 AbilityImpls( [ - @156-158 LabelOnly( - @156-158 "eq", + @213-215 LabelOnly( + @213-215 "eq", ), - @160-163 LabelOnly( - @160-163 "eq1", + @217-220 LabelOnly( + @217-220 "eq1", ), ], ), @@ -284,38 +284,38 @@ Defs( }, Opaque { header: TypeHeader { - name: @167-168 "A", + name: @224-225 "A", vars: [], }, - typ: @172-174 Apply( + typ: @229-231 Apply( "", "U8", [], ), derived: Some( - @179-199 Has( + @243-263 Implements( [ - @180-192 HasAbility { - ability: @180-182 Apply( + @244-256 ImplementsAbility { + ability: @244-246 Apply( "", "Eq", [], ), impls: Some( - @183-192 HasImpls( + @247-256 AbilityImpls( [ - @184-186 LabelOnly( - @184-186 "eq", + @248-250 LabelOnly( + @248-250 "eq", ), - @188-191 LabelOnly( - @188-191 "eq1", + @252-255 LabelOnly( + @252-255 "eq1", ), ], ), ), }, - @194-198 HasAbility { - ability: @194-198 Apply( + @258-262 ImplementsAbility { + ability: @258-262 Apply( "", "Hash", [], @@ -328,39 +328,39 @@ Defs( }, Opaque { header: TypeHeader { - name: @201-202 "A", + name: @265-266 "A", vars: [], }, - typ: @206-208 Apply( + typ: @270-272 Apply( "", "U8", [], ), derived: Some( - @213-233 Has( + @284-304 Implements( [ - @214-218 HasAbility { - ability: @214-218 Apply( + @285-289 ImplementsAbility { + ability: @285-289 Apply( "", "Hash", [], ), impls: None, }, - @220-232 HasAbility { - ability: @220-222 Apply( + @291-303 ImplementsAbility { + ability: @291-293 Apply( "", "Eq", [], ), impls: Some( - @223-232 HasImpls( + @294-303 AbilityImpls( [ - @224-226 LabelOnly( - @224-226 "eq", + @295-297 LabelOnly( + @295-297 "eq", ), - @228-231 LabelOnly( - @228-231 "eq1", + @299-302 LabelOnly( + @299-302 "eq1", ), ], ), @@ -372,34 +372,34 @@ Defs( }, Opaque { header: TypeHeader { - name: @235-236 "A", + name: @306-307 "A", vars: [], }, - typ: @240-242 Apply( + typ: @311-313 Apply( "", "U8", [], ), derived: Some( - @247-249 Has( + @325-327 Implements( [], ), ), }, Opaque { header: TypeHeader { - name: @251-252 "A", + name: @329-330 "A", vars: [], }, - typ: @256-271 Where( - @256-257 BoundVariable( + typ: @334-360 Where( + @334-335 BoundVariable( "a", ), [ - @260-271 HasClause { - var: @260-261 "a", + @342-360 ImplementsClause { + var: @342-343 "a", abilities: [ - @266-271 Apply( + @355-360 Apply( "", "Other", [], @@ -409,36 +409,36 @@ Defs( ], ), derived: Some( - @281-303 SpaceBefore( - Has( + @377-399 SpaceBefore( + Implements( [ - @282-289 HasAbility { - ability: @282-284 Apply( + @378-385 ImplementsAbility { + ability: @378-380 Apply( "", "Eq", [], ), impls: Some( - @285-289 HasImpls( + @381-385 AbilityImpls( [ - @286-288 LabelOnly( - @286-288 "eq", + @382-384 LabelOnly( + @382-384 "eq", ), ], ), ), }, - @291-302 HasAbility { - ability: @291-295 Apply( + @387-398 ImplementsAbility { + ability: @387-391 Apply( "", "Hash", [], ), impls: Some( - @296-302 HasImpls( + @392-398 AbilityImpls( [ - @297-301 LabelOnly( - @297-301 "hash", + @393-397 LabelOnly( + @393-397 "hash", ), ], ), @@ -454,25 +454,25 @@ Defs( }, Opaque { header: TypeHeader { - name: @305-306 "A", + name: @401-402 "A", vars: [], }, - typ: @310-312 Apply( + typ: @406-408 Apply( "", "U8", [], ), derived: Some( - @317-324 Has( + @420-427 Implements( [ - @318-323 HasAbility { - ability: @318-320 Apply( + @421-426 ImplementsAbility { + ability: @421-423 Apply( "", "Eq", [], ), impls: Some( - @321-323 HasImpls( + @424-426 AbilityImpls( [], ), ), @@ -484,7 +484,7 @@ Defs( ], value_defs: [], }, - @326-327 SpaceBefore( + @429-430 SpaceBefore( Num( "0", ), diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/where_clause_function.expr.result-ast b/crates/compiler/test_syntax/tests/snapshots/pass/where_clause_function.expr.result-ast index f06dab0871..02f717dfdf 100644 --- a/crates/compiler/test_syntax/tests/snapshots/pass/where_clause_function.expr.result-ast +++ b/crates/compiler/test_syntax/tests/snapshots/pass/where_clause_function.expr.result-ast @@ -4,7 +4,7 @@ Defs( Index(2147483648), ], regions: [ - @0-27, + @0-38, ], space_before: [ Slice(start = 0, length = 0), @@ -19,7 +19,7 @@ Defs( @0-1 Identifier( "f", ), - @4-27 Where( + @4-38 Where( @4-16 Function( [ @4-5 BoundVariable( @@ -38,10 +38,10 @@ Defs( ), ), [ - @20-27 HasClause { - var: @20-21 "a", + @24-38 ImplementsClause { + var: @24-25 "a", abilities: [ - @26-27 Apply( + @37-38 Apply( "", "A", [], @@ -53,7 +53,7 @@ Defs( ), ], }, - @29-30 SpaceBefore( + @40-41 SpaceBefore( Var { module_name: "", ident: "f", diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/where_clause_multiple_bound_abilities.expr.result-ast b/crates/compiler/test_syntax/tests/snapshots/pass/where_clause_multiple_bound_abilities.expr.result-ast index c68f1217e9..fd2cc42467 100644 --- a/crates/compiler/test_syntax/tests/snapshots/pass/where_clause_multiple_bound_abilities.expr.result-ast +++ b/crates/compiler/test_syntax/tests/snapshots/pass/where_clause_multiple_bound_abilities.expr.result-ast @@ -5,8 +5,8 @@ Defs( Index(2147483649), ], regions: [ - @0-55, - @57-118, + @0-73, + @75-154, ], space_before: [ Slice(start = 0, length = 0), @@ -26,7 +26,7 @@ Defs( @0-1 Identifier( "f", ), - @4-55 Where( + @4-73 Where( @4-10 Function( [ @4-5 BoundVariable( @@ -38,35 +38,35 @@ Defs( ), ), [ - @13-28 HasClause { - var: @13-14 "a", + @17-39 ImplementsClause { + var: @17-18 "a", abilities: [ - @19-23 Apply( + @30-34 Apply( "", "Hash", [], ), - @26-28 Apply( + @37-39 Apply( "", "Eq", [], ), ], }, - @30-55 HasClause { - var: @30-31 "b", + @41-73 ImplementsClause { + var: @41-42 "b", abilities: [ - @36-38 Apply( + @54-56 Apply( "", "Eq", [], ), - @41-45 Apply( + @59-63 Apply( "", "Hash", [], ), - @48-55 Apply( + @66-73 Apply( "", "Display", [], @@ -77,18 +77,18 @@ Defs( ), ), Annotation( - @57-58 Identifier( + @75-76 Identifier( "f", ), - @61-118 Where( - @61-67 SpaceAfter( + @79-154 Where( + @79-85 SpaceAfter( Function( [ - @61-62 BoundVariable( + @79-80 BoundVariable( "a", ), ], - @66-67 BoundVariable( + @84-85 BoundVariable( "b", ), ), @@ -97,40 +97,40 @@ Defs( ], ), [ - @72-87 HasClause { - var: @72-73 "a", + @94-116 ImplementsClause { + var: @94-95 "a", abilities: [ - @78-82 Apply( + @107-111 Apply( "", "Hash", [], ), - @85-87 Apply( + @114-116 Apply( "", "Eq", [], ), ], }, - @93-118 HasClause { - var: @93-94 SpaceBefore( + @122-154 ImplementsClause { + var: @122-123 SpaceBefore( "b", [ Newline, ], ), abilities: [ - @99-103 Apply( + @135-139 Apply( "", "Hash", [], ), - @106-113 Apply( + @142-149 Apply( "", "Display", [], ), - @116-118 Apply( + @152-154 Apply( "", "Eq", [], @@ -142,7 +142,7 @@ Defs( ), ], }, - @120-121 SpaceBefore( + @156-157 SpaceBefore( Var { module_name: "", ident: "f", diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/where_clause_multiple_has.expr.result-ast b/crates/compiler/test_syntax/tests/snapshots/pass/where_clause_multiple_has.expr.result-ast index 05f6b2b66d..e252c64ff9 100644 --- a/crates/compiler/test_syntax/tests/snapshots/pass/where_clause_multiple_has.expr.result-ast +++ b/crates/compiler/test_syntax/tests/snapshots/pass/where_clause_multiple_has.expr.result-ast @@ -4,7 +4,7 @@ Defs( Index(2147483648), ], regions: [ - @0-48, + @0-73, ], space_before: [ Slice(start = 0, length = 0), @@ -19,7 +19,7 @@ Defs( @0-1 Identifier( "f", ), - @4-48 Where( + @4-73 Where( @4-16 Function( [ @4-5 BoundVariable( @@ -38,30 +38,30 @@ Defs( ), ), [ - @20-27 HasClause { - var: @20-21 "a", + @24-38 ImplementsClause { + var: @24-25 "a", abilities: [ - @26-27 Apply( + @37-38 Apply( "", "A", [], ), ], }, - @29-37 HasClause { - var: @29-30 "b", + @40-55 ImplementsClause { + var: @40-41 "b", abilities: [ - @35-37 Apply( + @53-55 Apply( "", "Eq", [], ), ], }, - @39-48 HasClause { - var: @39-40 "c", + @57-73 ImplementsClause { + var: @57-58 "c", abilities: [ - @45-48 Apply( + @70-73 Apply( "", "Ord", [], @@ -73,7 +73,7 @@ Defs( ), ], }, - @50-51 SpaceBefore( + @75-76 SpaceBefore( Var { module_name: "", ident: "f", diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/where_clause_multiple_has_across_newlines.expr.formatted.roc b/crates/compiler/test_syntax/tests/snapshots/pass/where_clause_multiple_has_across_newlines.expr.formatted.roc index d5d6c87616..9076cc336a 100644 --- a/crates/compiler/test_syntax/tests/snapshots/pass/where_clause_multiple_has_across_newlines.expr.formatted.roc +++ b/crates/compiler/test_syntax/tests/snapshots/pass/where_clause_multiple_has_across_newlines.expr.formatted.roc @@ -1,3 +1,3 @@ -f : a -> (b -> c) where a implements Hash, b has Eq, c implements Ord +f : a -> (b -> c) where a implements Hash, b implements Eq, c implements Ord f \ No newline at end of file diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/where_clause_multiple_has_across_newlines.expr.result-ast b/crates/compiler/test_syntax/tests/snapshots/pass/where_clause_multiple_has_across_newlines.expr.result-ast index 8ea27a6af7..d29d1e2569 100644 --- a/crates/compiler/test_syntax/tests/snapshots/pass/where_clause_multiple_has_across_newlines.expr.result-ast +++ b/crates/compiler/test_syntax/tests/snapshots/pass/where_clause_multiple_has_across_newlines.expr.result-ast @@ -4,7 +4,7 @@ Defs( Index(2147483648), ], regions: [ - @0-67, + @0-92, ], space_before: [ Slice(start = 0, length = 0), @@ -19,7 +19,7 @@ Defs( @0-1 Identifier( "f", ), - @4-67 Where( + @4-92 Where( @4-16 SpaceAfter( Function( [ @@ -43,40 +43,40 @@ Defs( ], ), [ - @24-34 HasClause { - var: @24-25 "a", + @28-45 ImplementsClause { + var: @28-29 "a", abilities: [ - @30-34 Apply( + @41-45 Apply( "", "Hash", [], ), ], }, - @42-50 HasClause { - var: @42-43 SpaceBefore( + @53-68 ImplementsClause { + var: @53-54 SpaceBefore( "b", [ Newline, ], ), abilities: [ - @48-50 Apply( + @66-68 Apply( "", "Eq", [], ), ], }, - @58-67 HasClause { - var: @58-59 SpaceBefore( + @76-92 ImplementsClause { + var: @76-77 SpaceBefore( "c", [ Newline, ], ), abilities: [ - @64-67 Apply( + @89-92 Apply( "", "Ord", [], @@ -88,7 +88,7 @@ Defs( ), ], }, - @69-70 SpaceBefore( + @94-95 SpaceBefore( Var { module_name: "", ident: "f", diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/where_clause_non_function.expr.result-ast b/crates/compiler/test_syntax/tests/snapshots/pass/where_clause_non_function.expr.result-ast index 862b258bf8..30486cee67 100644 --- a/crates/compiler/test_syntax/tests/snapshots/pass/where_clause_non_function.expr.result-ast +++ b/crates/compiler/test_syntax/tests/snapshots/pass/where_clause_non_function.expr.result-ast @@ -4,7 +4,7 @@ Defs( Index(2147483648), ], regions: [ - @0-15, + @0-26, ], space_before: [ Slice(start = 0, length = 0), @@ -19,15 +19,15 @@ Defs( @0-1 Identifier( "f", ), - @4-15 Where( + @4-26 Where( @4-5 BoundVariable( "a", ), [ - @8-15 HasClause { - var: @8-9 "a", + @12-26 ImplementsClause { + var: @12-13 "a", abilities: [ - @14-15 Apply( + @25-26 Apply( "", "A", [], @@ -39,7 +39,7 @@ Defs( ), ], }, - @17-18 SpaceBefore( + @28-29 SpaceBefore( Var { module_name: "", ident: "f", diff --git a/crates/compiler/test_syntax/tests/snapshots/pass/where_clause_on_newline.expr.result-ast b/crates/compiler/test_syntax/tests/snapshots/pass/where_clause_on_newline.expr.result-ast index ad552875ed..ca97aea704 100644 --- a/crates/compiler/test_syntax/tests/snapshots/pass/where_clause_on_newline.expr.result-ast +++ b/crates/compiler/test_syntax/tests/snapshots/pass/where_clause_on_newline.expr.result-ast @@ -4,7 +4,7 @@ Defs( Index(2147483648), ], regions: [ - @0-29, + @0-40, ], space_before: [ Slice(start = 0, length = 0), @@ -19,7 +19,7 @@ Defs( @0-1 Identifier( "f", ), - @4-29 Where( + @4-40 Where( @4-12 SpaceAfter( Function( [ @@ -38,10 +38,10 @@ Defs( ], ), [ - @19-29 HasClause { - var: @19-20 "a", + @23-40 ImplementsClause { + var: @23-24 "a", abilities: [ - @25-29 Apply( + @36-40 Apply( "", "Hash", [], @@ -53,7 +53,7 @@ Defs( ), ], }, - @31-32 SpaceBefore( + @42-43 SpaceBefore( Var { module_name: "", ident: "f",