mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-04 20:28:02 +00:00
Introduce proper type for TypeVar's, mark anything not a lowercase ident as malformed
This commit is contained in:
parent
a9c25563b2
commit
d43ad92789
65 changed files with 729 additions and 460 deletions
|
@ -0,0 +1,10 @@
|
|||
O {
|
||||
p?? if
|
||||
a
|
||||
then
|
||||
A
|
||||
else
|
||||
&m,
|
||||
} #
|
||||
: e
|
||||
i
|
|
@ -0,0 +1,98 @@
|
|||
@0-29 SpaceAfter(
|
||||
Defs(
|
||||
Defs {
|
||||
tags: [
|
||||
EitherIndex(0),
|
||||
],
|
||||
regions: [
|
||||
@0-27,
|
||||
],
|
||||
space_before: [
|
||||
Slice<roc_parse::ast::CommentOrNewline> { start: 0, length: 0 },
|
||||
],
|
||||
space_after: [
|
||||
Slice<roc_parse::ast::CommentOrNewline> { start: 0, length: 0 },
|
||||
],
|
||||
spaces: [],
|
||||
type_defs: [
|
||||
Alias {
|
||||
header: TypeHeader {
|
||||
name: @0-1 "O",
|
||||
vars: [
|
||||
@1-23 SpaceAfter(
|
||||
Malformed(
|
||||
Record(
|
||||
[
|
||||
@2-22 OptionalValue(
|
||||
@2-3 "p",
|
||||
[],
|
||||
@4-22 If {
|
||||
if_thens: [
|
||||
(
|
||||
@7-8 SpaceBefore(
|
||||
SpaceAfter(
|
||||
Var {
|
||||
module_name: "",
|
||||
ident: "a",
|
||||
},
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
@14-15 SpaceBefore(
|
||||
SpaceAfter(
|
||||
Tag(
|
||||
"A",
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
final_else: @20-22 RecordUpdater(
|
||||
"m",
|
||||
),
|
||||
indented_else: false,
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
[
|
||||
LineComment(
|
||||
"",
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
},
|
||||
ann: @26-27 BoundVariable(
|
||||
"e",
|
||||
),
|
||||
},
|
||||
],
|
||||
value_defs: [],
|
||||
},
|
||||
@28-29 SpaceBefore(
|
||||
Var {
|
||||
module_name: "",
|
||||
ident: "i",
|
||||
},
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
)
|
|
@ -0,0 +1,7 @@
|
|||
O{p?if
|
||||
a
|
||||
then
|
||||
A
|
||||
else&m}#
|
||||
:e
|
||||
i
|
|
@ -0,0 +1,3 @@
|
|||
C 4 #
|
||||
implements e : m
|
||||
C
|
|
@ -0,0 +1,61 @@
|
|||
@0-23 SpaceAfter(
|
||||
Defs(
|
||||
Defs {
|
||||
tags: [
|
||||
EitherIndex(0),
|
||||
],
|
||||
regions: [
|
||||
@0-21,
|
||||
],
|
||||
space_before: [
|
||||
Slice<roc_parse::ast::CommentOrNewline> { start: 0, length: 0 },
|
||||
],
|
||||
space_after: [
|
||||
Slice<roc_parse::ast::CommentOrNewline> { start: 0, length: 0 },
|
||||
],
|
||||
spaces: [],
|
||||
type_defs: [
|
||||
Ability {
|
||||
header: TypeHeader {
|
||||
name: @0-1 "C",
|
||||
vars: [
|
||||
@2-3 Malformed(
|
||||
Num(
|
||||
"4",
|
||||
),
|
||||
),
|
||||
],
|
||||
},
|
||||
loc_implements: @7-17 SpaceBefore(
|
||||
Implements,
|
||||
[
|
||||
LineComment(
|
||||
"",
|
||||
),
|
||||
],
|
||||
),
|
||||
members: [
|
||||
AbilityMember {
|
||||
name: @18-19 "e",
|
||||
typ: @20-21 BoundVariable(
|
||||
"m",
|
||||
),
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
value_defs: [],
|
||||
},
|
||||
@22-23 SpaceBefore(
|
||||
Tag(
|
||||
"C",
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
)
|
|
@ -0,0 +1,3 @@
|
|||
C 4 #
|
||||
implements e:m
|
||||
C
|
|
@ -0,0 +1,2 @@
|
|||
N (implements) h (0) : B
|
||||
T
|
|
@ -0,0 +1,63 @@
|
|||
@0-24 SpaceAfter(
|
||||
Defs(
|
||||
Defs {
|
||||
tags: [
|
||||
EitherIndex(0),
|
||||
],
|
||||
regions: [
|
||||
@0-22,
|
||||
],
|
||||
space_before: [
|
||||
Slice<roc_parse::ast::CommentOrNewline> { start: 0, length: 0 },
|
||||
],
|
||||
space_after: [
|
||||
Slice<roc_parse::ast::CommentOrNewline> { start: 0, length: 0 },
|
||||
],
|
||||
spaces: [],
|
||||
type_defs: [
|
||||
Alias {
|
||||
header: TypeHeader {
|
||||
name: @0-1 "N",
|
||||
vars: [
|
||||
@3-13 Malformed(
|
||||
ParensAround(
|
||||
Var {
|
||||
module_name: "",
|
||||
ident: "implements",
|
||||
},
|
||||
),
|
||||
),
|
||||
@15-16 Identifier(
|
||||
"h",
|
||||
),
|
||||
@18-19 Malformed(
|
||||
ParensAround(
|
||||
Num(
|
||||
"0",
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
},
|
||||
ann: @21-22 Apply(
|
||||
"",
|
||||
"B",
|
||||
[],
|
||||
),
|
||||
},
|
||||
],
|
||||
value_defs: [],
|
||||
},
|
||||
@23-24 SpaceBefore(
|
||||
Tag(
|
||||
"T",
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
)
|
|
@ -0,0 +1,2 @@
|
|||
N (implements) h (0):B
|
||||
T
|
|
@ -0,0 +1,2 @@
|
|||
N -0 T : A
|
||||
zT
|
|
@ -0,0 +1,56 @@
|
|||
@0-11 SpaceAfter(
|
||||
Defs(
|
||||
Defs {
|
||||
tags: [
|
||||
EitherIndex(0),
|
||||
],
|
||||
regions: [
|
||||
@0-8,
|
||||
],
|
||||
space_before: [
|
||||
Slice<roc_parse::ast::CommentOrNewline> { start: 0, length: 0 },
|
||||
],
|
||||
space_after: [
|
||||
Slice<roc_parse::ast::CommentOrNewline> { start: 0, length: 0 },
|
||||
],
|
||||
spaces: [],
|
||||
type_defs: [
|
||||
Alias {
|
||||
header: TypeHeader {
|
||||
name: @0-1 "N",
|
||||
vars: [
|
||||
@2-4 Malformed(
|
||||
Num(
|
||||
"-0",
|
||||
),
|
||||
),
|
||||
@5-6 Malformed(
|
||||
Tag(
|
||||
"T",
|
||||
),
|
||||
),
|
||||
],
|
||||
},
|
||||
ann: @7-8 Apply(
|
||||
"",
|
||||
"A",
|
||||
[],
|
||||
),
|
||||
},
|
||||
],
|
||||
value_defs: [],
|
||||
},
|
||||
@9-11 SpaceBefore(
|
||||
Var {
|
||||
module_name: "",
|
||||
ident: "zT",
|
||||
},
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
)
|
|
@ -0,0 +1,2 @@
|
|||
N -0 T:A
|
||||
zT
|
|
@ -0,0 +1,4 @@
|
|||
B @A : w
|
||||
#
|
||||
@A = e
|
||||
i
|
|
@ -0,0 +1,68 @@
|
|||
@0-14 SpaceAfter(
|
||||
Defs(
|
||||
Defs {
|
||||
tags: [
|
||||
EitherIndex(0),
|
||||
EitherIndex(2147483648),
|
||||
],
|
||||
regions: [
|
||||
@0-5,
|
||||
@8-12,
|
||||
],
|
||||
space_before: [
|
||||
Slice<roc_parse::ast::CommentOrNewline> { start: 0, length: 0 },
|
||||
Slice<roc_parse::ast::CommentOrNewline> { start: 0, length: 2 },
|
||||
],
|
||||
space_after: [
|
||||
Slice<roc_parse::ast::CommentOrNewline> { start: 0, length: 0 },
|
||||
Slice<roc_parse::ast::CommentOrNewline> { start: 2, length: 0 },
|
||||
],
|
||||
spaces: [
|
||||
Newline,
|
||||
LineComment(
|
||||
"",
|
||||
),
|
||||
],
|
||||
type_defs: [
|
||||
Alias {
|
||||
header: TypeHeader {
|
||||
name: @0-1 "B",
|
||||
vars: [
|
||||
@1-3 Malformed(
|
||||
OpaqueRef(
|
||||
"@A",
|
||||
),
|
||||
),
|
||||
],
|
||||
},
|
||||
ann: @4-5 BoundVariable(
|
||||
"w",
|
||||
),
|
||||
},
|
||||
],
|
||||
value_defs: [
|
||||
Body(
|
||||
@8-10 OpaqueRef(
|
||||
"@A",
|
||||
),
|
||||
@11-12 Var {
|
||||
module_name: "",
|
||||
ident: "e",
|
||||
},
|
||||
),
|
||||
],
|
||||
},
|
||||
@13-14 SpaceBefore(
|
||||
Var {
|
||||
module_name: "",
|
||||
ident: "i",
|
||||
},
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
)
|
|
@ -0,0 +1,4 @@
|
|||
B@A:w
|
||||
#
|
||||
@A=e
|
||||
i
|
|
@ -0,0 +1,3 @@
|
|||
Zx (e #
|
||||
) f : i
|
||||
s
|
|
@ -0,0 +1,62 @@
|
|||
@0-13 SpaceAfter(
|
||||
Defs(
|
||||
Defs {
|
||||
tags: [
|
||||
EitherIndex(0),
|
||||
],
|
||||
regions: [
|
||||
@0-11,
|
||||
],
|
||||
space_before: [
|
||||
Slice<roc_parse::ast::CommentOrNewline> { start: 0, length: 0 },
|
||||
],
|
||||
space_after: [
|
||||
Slice<roc_parse::ast::CommentOrNewline> { start: 0, length: 0 },
|
||||
],
|
||||
spaces: [],
|
||||
type_defs: [
|
||||
Alias {
|
||||
header: TypeHeader {
|
||||
name: @0-2 "Zx",
|
||||
vars: [
|
||||
@4-5 Malformed(
|
||||
ParensAround(
|
||||
SpaceAfter(
|
||||
Var {
|
||||
module_name: "",
|
||||
ident: "e",
|
||||
},
|
||||
[
|
||||
LineComment(
|
||||
"",
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
@8-9 Identifier(
|
||||
"f",
|
||||
),
|
||||
],
|
||||
},
|
||||
ann: @10-11 BoundVariable(
|
||||
"i",
|
||||
),
|
||||
},
|
||||
],
|
||||
value_defs: [],
|
||||
},
|
||||
@12-13 SpaceBefore(
|
||||
Var {
|
||||
module_name: "",
|
||||
ident: "s",
|
||||
},
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
)
|
|
@ -0,0 +1,3 @@
|
|||
Zx (e#
|
||||
)f:i
|
||||
s
|
|
@ -0,0 +1,2 @@
|
|||
U (b a) : b
|
||||
a
|
|
@ -0,0 +1,61 @@
|
|||
@0-11 SpaceAfter(
|
||||
Defs(
|
||||
Defs {
|
||||
tags: [
|
||||
EitherIndex(0),
|
||||
],
|
||||
regions: [
|
||||
@0-9,
|
||||
],
|
||||
space_before: [
|
||||
Slice<roc_parse::ast::CommentOrNewline> { start: 0, length: 0 },
|
||||
],
|
||||
space_after: [
|
||||
Slice<roc_parse::ast::CommentOrNewline> { start: 0, length: 0 },
|
||||
],
|
||||
spaces: [],
|
||||
type_defs: [
|
||||
Alias {
|
||||
header: TypeHeader {
|
||||
name: @0-1 "U",
|
||||
vars: [
|
||||
@3-6 Malformed(
|
||||
ParensAround(
|
||||
Apply(
|
||||
@3-4 Var {
|
||||
module_name: "",
|
||||
ident: "b",
|
||||
},
|
||||
[
|
||||
@5-6 Var {
|
||||
module_name: "",
|
||||
ident: "a",
|
||||
},
|
||||
],
|
||||
Space,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
},
|
||||
ann: @8-9 BoundVariable(
|
||||
"b",
|
||||
),
|
||||
},
|
||||
],
|
||||
value_defs: [],
|
||||
},
|
||||
@10-11 SpaceBefore(
|
||||
Var {
|
||||
module_name: "",
|
||||
ident: "a",
|
||||
},
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
)
|
|
@ -0,0 +1,2 @@
|
|||
U (b a):b
|
||||
a
|
|
@ -0,0 +1,10 @@
|
|||
M {
|
||||
s?? s
|
||||
{ J &
|
||||
},
|
||||
} {
|
||||
s?? s
|
||||
{ J &
|
||||
},
|
||||
} : p
|
||||
y
|
|
@ -0,0 +1,104 @@
|
|||
@0-25 SpaceAfter(
|
||||
Defs(
|
||||
Defs {
|
||||
tags: [
|
||||
EitherIndex(0),
|
||||
],
|
||||
regions: [
|
||||
@0-23,
|
||||
],
|
||||
space_before: [
|
||||
Slice<roc_parse::ast::CommentOrNewline> { start: 0, length: 0 },
|
||||
],
|
||||
space_after: [
|
||||
Slice<roc_parse::ast::CommentOrNewline> { start: 0, length: 0 },
|
||||
],
|
||||
spaces: [],
|
||||
type_defs: [
|
||||
Alias {
|
||||
header: TypeHeader {
|
||||
name: @0-1 "M",
|
||||
vars: [
|
||||
@1-11 Malformed(
|
||||
Record(
|
||||
[
|
||||
@2-10 OptionalValue(
|
||||
@2-3 "s",
|
||||
[],
|
||||
@4-10 Apply(
|
||||
@4-5 Var {
|
||||
module_name: "",
|
||||
ident: "s",
|
||||
},
|
||||
[
|
||||
@5-10 RecordUpdate {
|
||||
update: @6-7 Tag(
|
||||
"J",
|
||||
),
|
||||
fields: Collection {
|
||||
items: [],
|
||||
final_comments: [
|
||||
Newline,
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
Space,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
@11-21 Malformed(
|
||||
Record(
|
||||
[
|
||||
@12-20 OptionalValue(
|
||||
@12-13 "s",
|
||||
[],
|
||||
@14-20 Apply(
|
||||
@14-15 Var {
|
||||
module_name: "",
|
||||
ident: "s",
|
||||
},
|
||||
[
|
||||
@15-20 RecordUpdate {
|
||||
update: @16-17 Tag(
|
||||
"J",
|
||||
),
|
||||
fields: Collection {
|
||||
items: [],
|
||||
final_comments: [
|
||||
Newline,
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
Space,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
},
|
||||
ann: @22-23 BoundVariable(
|
||||
"p",
|
||||
),
|
||||
},
|
||||
],
|
||||
value_defs: [],
|
||||
},
|
||||
@24-25 SpaceBefore(
|
||||
Var {
|
||||
module_name: "",
|
||||
ident: "y",
|
||||
},
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
)
|
|
@ -0,0 +1,4 @@
|
|||
M{s?s{J&
|
||||
}}{s?s{J&
|
||||
}}:p
|
||||
y
|
|
@ -0,0 +1,5 @@
|
|||
Q (
|
||||
"""
|
||||
"""
|
||||
"") : a
|
||||
q
|
|
@ -0,0 +1,63 @@
|
|||
@0-16 SpaceAfter(
|
||||
Defs(
|
||||
Defs {
|
||||
tags: [
|
||||
EitherIndex(0),
|
||||
],
|
||||
regions: [
|
||||
@0-14,
|
||||
],
|
||||
space_before: [
|
||||
Slice<roc_parse::ast::CommentOrNewline> { start: 0, length: 0 },
|
||||
],
|
||||
space_after: [
|
||||
Slice<roc_parse::ast::CommentOrNewline> { start: 0, length: 0 },
|
||||
],
|
||||
spaces: [],
|
||||
type_defs: [
|
||||
Alias {
|
||||
header: TypeHeader {
|
||||
name: @0-1 "Q",
|
||||
vars: [
|
||||
@3-11 Malformed(
|
||||
ParensAround(
|
||||
Apply(
|
||||
@3-9 Str(
|
||||
Block(
|
||||
[],
|
||||
),
|
||||
),
|
||||
[
|
||||
@9-11 Str(
|
||||
PlainLine(
|
||||
"",
|
||||
),
|
||||
),
|
||||
],
|
||||
Space,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
},
|
||||
ann: @13-14 BoundVariable(
|
||||
"a",
|
||||
),
|
||||
},
|
||||
],
|
||||
value_defs: [],
|
||||
},
|
||||
@15-16 SpaceBefore(
|
||||
Var {
|
||||
module_name: "",
|
||||
ident: "q",
|
||||
},
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
)
|
|
@ -0,0 +1,2 @@
|
|||
Q (""""""""):a
|
||||
q
|
|
@ -0,0 +1,4 @@
|
|||
il3 \k -> # w#z
|
||||
CCC @C ( # i
|
||||
t! K) : i
|
||||
C
|
|
@ -0,0 +1,94 @@
|
|||
@0-32 SpaceAfter(
|
||||
Apply(
|
||||
@0-3 Var {
|
||||
module_name: "",
|
||||
ident: "il3",
|
||||
},
|
||||
[
|
||||
@3-32 Closure(
|
||||
[
|
||||
@4-5 Identifier {
|
||||
ident: "k",
|
||||
},
|
||||
],
|
||||
@13-32 SpaceBefore(
|
||||
Defs(
|
||||
Defs {
|
||||
tags: [
|
||||
EitherIndex(0),
|
||||
],
|
||||
regions: [
|
||||
@13-29,
|
||||
],
|
||||
space_before: [
|
||||
Slice<roc_parse::ast::CommentOrNewline> { start: 0, length: 0 },
|
||||
],
|
||||
space_after: [
|
||||
Slice<roc_parse::ast::CommentOrNewline> { start: 0, length: 0 },
|
||||
],
|
||||
spaces: [],
|
||||
type_defs: [
|
||||
Alias {
|
||||
header: TypeHeader {
|
||||
name: @13-16 "CCC",
|
||||
vars: [
|
||||
@16-18 Malformed(
|
||||
OpaqueRef(
|
||||
"@C",
|
||||
),
|
||||
),
|
||||
@23-26 Malformed(
|
||||
ParensAround(
|
||||
SpaceBefore(
|
||||
Apply(
|
||||
@23-25 Var {
|
||||
module_name: "",
|
||||
ident: "t!",
|
||||
},
|
||||
[
|
||||
@25-26 Tag(
|
||||
"K",
|
||||
),
|
||||
],
|
||||
Space,
|
||||
),
|
||||
[
|
||||
LineComment(
|
||||
"i",
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
},
|
||||
ann: @28-29 BoundVariable(
|
||||
"i",
|
||||
),
|
||||
},
|
||||
],
|
||||
value_defs: [],
|
||||
},
|
||||
@31-32 SpaceBefore(
|
||||
Tag(
|
||||
"C",
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
),
|
||||
[
|
||||
LineComment(
|
||||
"w#z",
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
Space,
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
)
|
|
@ -0,0 +1,4 @@
|
|||
il3\k->#w#z
|
||||
CCC@C (#i
|
||||
t!K):i
|
||||
C
|
Loading…
Add table
Add a link
Reference in a new issue