Add test for empty impl block parse

This commit is contained in:
Ayaz Hafiz 2022-07-15 11:15:44 -04:00
parent ecaccdaac3
commit 4d54e2ee3c
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
2 changed files with 38 additions and 1 deletions

View file

@ -10,6 +10,7 @@ Defs(
Index(6),
Index(7),
Index(8),
Index(9),
],
regions: [
@0-7,
@ -21,6 +22,7 @@ Defs(
@201-208,
@235-242,
@251-271,
@305-312,
],
space_before: [
Slice(start = 0, length = 0),
@ -32,6 +34,7 @@ Defs(
Slice(start = 10, length = 2),
Slice(start = 12, length = 2),
Slice(start = 14, length = 2),
Slice(start = 16, length = 2),
],
space_after: [
Slice(start = 0, length = 0),
@ -43,6 +46,7 @@ Defs(
Slice(start = 12, length = 0),
Slice(start = 14, length = 0),
Slice(start = 16, length = 0),
Slice(start = 18, length = 0),
],
spaces: [
Newline,
@ -61,6 +65,8 @@ Defs(
Newline,
Newline,
Newline,
Newline,
Newline,
],
type_defs: [
Opaque {
@ -440,10 +446,39 @@ Defs(
),
),
},
Opaque {
header: TypeHeader {
name: @305-306 "A",
vars: [],
},
typ: @310-312 Apply(
"",
"U8",
[],
),
derived: Some(
@317-324 Has(
[
@318-323 HasAbility {
ability: @318-320 Apply(
"",
"Eq",
[],
),
impls: Some(
@321-323 HasImpls(
[],
),
),
},
],
),
),
},
],
value_defs: [],
},
@305-306 SpaceBefore(
@326-327 SpaceBefore(
Num(
"0",
),

View file

@ -18,4 +18,6 @@ A := U8 has []
A := a | a has Other
has [Eq {eq}, Hash {hash}]
A := U8 has [Eq {}]
0