mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-04 04:08:19 +00:00
Fix approximately a bajillion fmt and parsing bugs
(discovered by fuzzing) There's more to come, but this seems like a good batch for now.
This commit is contained in:
parent
8f62eeaf7e
commit
0b8e68f70d
68 changed files with 1011 additions and 229 deletions
|
@ -1 +1 @@
|
|||
Expr(BadExprEnd(@20), @0)
|
||||
Expr(BadExprEnd(@22), @0)
|
|
@ -0,0 +1,3 @@
|
|||
f
|
||||
-5
|
||||
2
|
|
@ -0,0 +1,25 @@
|
|||
Apply(
|
||||
@0-1 SpaceAfter(
|
||||
Var {
|
||||
module_name: "",
|
||||
ident: "f",
|
||||
},
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
[
|
||||
@2-4 Num(
|
||||
"-5",
|
||||
),
|
||||
@5-6 SpaceBefore(
|
||||
Num(
|
||||
"2",
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
],
|
||||
Space,
|
||||
)
|
|
@ -0,0 +1,3 @@
|
|||
f
|
||||
-5
|
||||
2
|
|
@ -0,0 +1,3 @@
|
|||
F : e #
|
||||
|
||||
q
|
|
@ -0,0 +1,42 @@
|
|||
Defs(
|
||||
Defs {
|
||||
tags: [
|
||||
Index(0),
|
||||
],
|
||||
regions: [
|
||||
@0-3,
|
||||
],
|
||||
space_before: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
space_after: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
spaces: [],
|
||||
type_defs: [
|
||||
Alias {
|
||||
header: TypeHeader {
|
||||
name: @0-1 "F",
|
||||
vars: [],
|
||||
},
|
||||
ann: @2-3 BoundVariable(
|
||||
"e",
|
||||
),
|
||||
},
|
||||
],
|
||||
value_defs: [],
|
||||
},
|
||||
@7-8 SpaceBefore(
|
||||
Var {
|
||||
module_name: "",
|
||||
ident: "q",
|
||||
},
|
||||
[
|
||||
LineComment(
|
||||
"",
|
||||
),
|
||||
Newline,
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
)
|
|
@ -0,0 +1,4 @@
|
|||
F:e#
|
||||
|
||||
|
||||
q
|
|
@ -0,0 +1 @@
|
|||
i # abc
|
|
@ -0,0 +1,13 @@
|
|||
ParensAround(
|
||||
SpaceAfter(
|
||||
Var {
|
||||
module_name: "",
|
||||
ident: "i",
|
||||
},
|
||||
[
|
||||
LineComment(
|
||||
"abc",
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
|
@ -0,0 +1,2 @@
|
|||
(i#abc
|
||||
)
|
|
@ -0,0 +1,4 @@
|
|||
Z #
|
||||
h
|
||||
: a
|
||||
j
|
|
@ -0,0 +1,54 @@
|
|||
Defs(
|
||||
Defs {
|
||||
tags: [
|
||||
Index(0),
|
||||
],
|
||||
regions: [
|
||||
@0-7,
|
||||
],
|
||||
space_before: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
space_after: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
spaces: [],
|
||||
type_defs: [
|
||||
Alias {
|
||||
header: TypeHeader {
|
||||
name: @0-1 "Z",
|
||||
vars: [
|
||||
@3-4 SpaceAfter(
|
||||
SpaceBefore(
|
||||
Identifier(
|
||||
"h",
|
||||
),
|
||||
[
|
||||
LineComment(
|
||||
"",
|
||||
),
|
||||
],
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
],
|
||||
},
|
||||
ann: @6-7 BoundVariable(
|
||||
"a",
|
||||
),
|
||||
},
|
||||
],
|
||||
value_defs: [],
|
||||
},
|
||||
@8-9 SpaceBefore(
|
||||
Var {
|
||||
module_name: "",
|
||||
ident: "j",
|
||||
},
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
)
|
|
@ -0,0 +1,4 @@
|
|||
Z#
|
||||
h
|
||||
:a
|
||||
j
|
|
@ -0,0 +1,3 @@
|
|||
w #
|
||||
: n
|
||||
Q
|
|
@ -0,0 +1,43 @@
|
|||
Defs(
|
||||
Defs {
|
||||
tags: [
|
||||
Index(2147483648),
|
||||
],
|
||||
regions: [
|
||||
@0-5,
|
||||
],
|
||||
space_before: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
space_after: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
spaces: [],
|
||||
type_defs: [],
|
||||
value_defs: [
|
||||
Annotation(
|
||||
@0-1 SpaceAfter(
|
||||
Identifier(
|
||||
"w",
|
||||
),
|
||||
[
|
||||
LineComment(
|
||||
"",
|
||||
),
|
||||
],
|
||||
),
|
||||
@4-5 BoundVariable(
|
||||
"n",
|
||||
),
|
||||
),
|
||||
],
|
||||
},
|
||||
@6-7 SpaceBefore(
|
||||
Tag(
|
||||
"Q",
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
)
|
|
@ -0,0 +1,3 @@
|
|||
w#
|
||||
:n
|
||||
Q
|
|
@ -0,0 +1,3 @@
|
|||
t #
|
||||
= 3
|
||||
e
|
|
@ -0,0 +1,44 @@
|
|||
Defs(
|
||||
Defs {
|
||||
tags: [
|
||||
Index(2147483648),
|
||||
],
|
||||
regions: [
|
||||
@0-5,
|
||||
],
|
||||
space_before: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
space_after: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
spaces: [],
|
||||
type_defs: [],
|
||||
value_defs: [
|
||||
Body(
|
||||
@0-1 SpaceAfter(
|
||||
Identifier(
|
||||
"t",
|
||||
),
|
||||
[
|
||||
LineComment(
|
||||
"",
|
||||
),
|
||||
],
|
||||
),
|
||||
@4-5 Num(
|
||||
"3",
|
||||
),
|
||||
),
|
||||
],
|
||||
},
|
||||
@6-7 SpaceBefore(
|
||||
Var {
|
||||
module_name: "",
|
||||
ident: "e",
|
||||
},
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
)
|
|
@ -0,0 +1,3 @@
|
|||
t#
|
||||
=3
|
||||
e
|
|
@ -16,8 +16,11 @@ Defs(
|
|||
type_defs: [],
|
||||
value_defs: [
|
||||
Body(
|
||||
@0-7 Malformed(
|
||||
@0-7 MalformedIdent(
|
||||
"my_list",
|
||||
Underscore(
|
||||
@3,
|
||||
),
|
||||
),
|
||||
@10-58 List(
|
||||
Collection {
|
||||
|
|
|
@ -16,8 +16,11 @@ Defs(
|
|||
type_defs: [],
|
||||
value_defs: [
|
||||
Body(
|
||||
@0-7 Malformed(
|
||||
@0-7 MalformedIdent(
|
||||
"my_list",
|
||||
Underscore(
|
||||
@3,
|
||||
),
|
||||
),
|
||||
@10-26 List(
|
||||
[
|
||||
|
|
|
@ -16,8 +16,11 @@ Defs(
|
|||
type_defs: [],
|
||||
value_defs: [
|
||||
Body(
|
||||
@0-7 Malformed(
|
||||
@0-7 MalformedIdent(
|
||||
"my_list",
|
||||
Underscore(
|
||||
@3,
|
||||
),
|
||||
),
|
||||
@10-27 List(
|
||||
Collection {
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
(F 1), r <- a
|
||||
W
|
|
@ -0,0 +1,29 @@
|
|||
Backpassing(
|
||||
[
|
||||
@0-3 Apply(
|
||||
@0-1 Tag(
|
||||
"F",
|
||||
),
|
||||
[
|
||||
@2-3 NumLiteral(
|
||||
"1",
|
||||
),
|
||||
],
|
||||
),
|
||||
@5-6 Identifier(
|
||||
"r",
|
||||
),
|
||||
],
|
||||
@10-11 Var {
|
||||
module_name: "",
|
||||
ident: "a",
|
||||
},
|
||||
@12-13 SpaceBefore(
|
||||
Tag(
|
||||
"W",
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
)
|
|
@ -0,0 +1,2 @@
|
|||
F 1, r <- a
|
||||
W
|
|
@ -0,0 +1,4 @@
|
|||
e
|
||||
"""
|
||||
"\"
|
||||
"""
|
|
@ -0,0 +1,23 @@
|
|||
Apply(
|
||||
@0-1 Var {
|
||||
module_name: "",
|
||||
ident: "e",
|
||||
},
|
||||
[
|
||||
@1-10 Str(
|
||||
Block(
|
||||
[
|
||||
[
|
||||
Plaintext(
|
||||
"\"",
|
||||
),
|
||||
EscapedChar(
|
||||
DoubleQuote,
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
Space,
|
||||
)
|
|
@ -0,0 +1 @@
|
|||
e""""\""""
|
|
@ -0,0 +1,3 @@
|
|||
!
|
||||
"""
|
||||
"""
|
|
@ -0,0 +1,8 @@
|
|||
UnaryOp(
|
||||
@1-7 Str(
|
||||
Block(
|
||||
[],
|
||||
),
|
||||
),
|
||||
@0-1 Not,
|
||||
)
|
|
@ -0,0 +1 @@
|
|||
!""""""
|
|
@ -0,0 +1,4 @@
|
|||
a = A
|
||||
-g
|
||||
a
|
||||
a
|
|
@ -0,0 +1,58 @@
|
|||
Defs(
|
||||
Defs {
|
||||
tags: [
|
||||
Index(2147483648),
|
||||
],
|
||||
regions: [
|
||||
@0-9,
|
||||
],
|
||||
space_before: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
space_after: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
spaces: [],
|
||||
type_defs: [],
|
||||
value_defs: [
|
||||
Body(
|
||||
@0-1 Identifier(
|
||||
"a",
|
||||
),
|
||||
@2-9 Apply(
|
||||
@2-3 SpaceAfter(
|
||||
Tag(
|
||||
"A",
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
[
|
||||
@5-7 UnaryOp(
|
||||
@6-7 Var {
|
||||
module_name: "",
|
||||
ident: "g",
|
||||
},
|
||||
@5-6 Negate,
|
||||
),
|
||||
@8-9 Var {
|
||||
module_name: "",
|
||||
ident: "a",
|
||||
},
|
||||
],
|
||||
Space,
|
||||
),
|
||||
),
|
||||
],
|
||||
},
|
||||
@10-11 SpaceBefore(
|
||||
Var {
|
||||
module_name: "",
|
||||
ident: "a",
|
||||
},
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
)
|
|
@ -0,0 +1,3 @@
|
|||
a=A
|
||||
-g a
|
||||
a
|
|
@ -0,0 +1,4 @@
|
|||
x =
|
||||
a : n
|
||||
4
|
||||
_
|
|
@ -0,0 +1,64 @@
|
|||
Defs(
|
||||
Defs {
|
||||
tags: [
|
||||
Index(2147483648),
|
||||
],
|
||||
regions: [
|
||||
@0-7,
|
||||
],
|
||||
space_before: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
space_after: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
spaces: [],
|
||||
type_defs: [],
|
||||
value_defs: [
|
||||
Body(
|
||||
@0-1 Identifier(
|
||||
"x",
|
||||
),
|
||||
@2-7 Defs(
|
||||
Defs {
|
||||
tags: [
|
||||
Index(2147483648),
|
||||
],
|
||||
regions: [
|
||||
@2-5,
|
||||
],
|
||||
space_before: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
space_after: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
spaces: [],
|
||||
type_defs: [],
|
||||
value_defs: [
|
||||
Annotation(
|
||||
@2-3 Identifier(
|
||||
"a",
|
||||
),
|
||||
@4-5 BoundVariable(
|
||||
"n",
|
||||
),
|
||||
),
|
||||
],
|
||||
},
|
||||
@6-7 Num(
|
||||
"4",
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
},
|
||||
@8-9 SpaceBefore(
|
||||
Underscore(
|
||||
"",
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
)
|
|
@ -0,0 +1,2 @@
|
|||
x=a:n 4
|
||||
_
|
|
@ -0,0 +1 @@
|
|||
A
|
|
@ -0,0 +1,10 @@
|
|||
ParensAround(
|
||||
SpaceBefore(
|
||||
Tag(
|
||||
"A",
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
)
|
|
@ -0,0 +1,2 @@
|
|||
(
|
||||
A)
|
|
@ -0,0 +1,5 @@
|
|||
7
|
||||
== (
|
||||
Q : c
|
||||
42
|
||||
)
|
|
@ -0,0 +1,49 @@
|
|||
BinOps(
|
||||
[
|
||||
(
|
||||
@0-1 SpaceAfter(
|
||||
Num(
|
||||
"7",
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
@2-4 Equals,
|
||||
),
|
||||
],
|
||||
@5-11 ParensAround(
|
||||
Defs(
|
||||
Defs {
|
||||
tags: [
|
||||
Index(0),
|
||||
],
|
||||
regions: [
|
||||
@5-8,
|
||||
],
|
||||
space_before: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
space_after: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
spaces: [],
|
||||
type_defs: [
|
||||
Alias {
|
||||
header: TypeHeader {
|
||||
name: @5-6 "Q",
|
||||
vars: [],
|
||||
},
|
||||
ann: @7-8 BoundVariable(
|
||||
"c",
|
||||
),
|
||||
},
|
||||
],
|
||||
value_defs: [],
|
||||
},
|
||||
@9-11 Num(
|
||||
"42",
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
|
@ -0,0 +1,2 @@
|
|||
7
|
||||
==(Q:c 42)
|
|
@ -0,0 +1,3 @@
|
|||
A : A
|
||||
A
|
||||
p
|
|
@ -0,0 +1,51 @@
|
|||
Defs(
|
||||
Defs {
|
||||
tags: [
|
||||
Index(0),
|
||||
],
|
||||
regions: [
|
||||
@0-6,
|
||||
],
|
||||
space_before: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
space_after: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
spaces: [],
|
||||
type_defs: [
|
||||
Alias {
|
||||
header: TypeHeader {
|
||||
name: @0-1 "A",
|
||||
vars: [],
|
||||
},
|
||||
ann: @2-6 Apply(
|
||||
"",
|
||||
"A",
|
||||
[
|
||||
@5-6 SpaceBefore(
|
||||
Apply(
|
||||
"",
|
||||
"A",
|
||||
[],
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
},
|
||||
],
|
||||
value_defs: [],
|
||||
},
|
||||
@7-8 SpaceBefore(
|
||||
Var {
|
||||
module_name: "",
|
||||
ident: "p",
|
||||
},
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
)
|
|
@ -0,0 +1,3 @@
|
|||
A:A
|
||||
A
|
||||
p
|
|
@ -0,0 +1,2 @@
|
|||
J : R
|
||||
n_p
|
|
@ -0,0 +1,42 @@
|
|||
Defs(
|
||||
Defs {
|
||||
tags: [
|
||||
Index(0),
|
||||
],
|
||||
regions: [
|
||||
@0-3,
|
||||
],
|
||||
space_before: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
space_after: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
spaces: [],
|
||||
type_defs: [
|
||||
Alias {
|
||||
header: TypeHeader {
|
||||
name: @0-1 "J",
|
||||
vars: [],
|
||||
},
|
||||
ann: @2-3 Apply(
|
||||
"",
|
||||
"R",
|
||||
[],
|
||||
),
|
||||
},
|
||||
],
|
||||
value_defs: [],
|
||||
},
|
||||
@5-8 SpaceBefore(
|
||||
MalformedIdent(
|
||||
"n_p",
|
||||
Underscore(
|
||||
@7,
|
||||
),
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
)
|
|
@ -0,0 +1,2 @@
|
|||
J:R
|
||||
n_p
|
|
@ -0,0 +1,3 @@
|
|||
a : F
|
||||
F : h
|
||||
abc
|
|
@ -0,0 +1,55 @@
|
|||
Defs(
|
||||
Defs {
|
||||
tags: [
|
||||
Index(2147483648),
|
||||
Index(0),
|
||||
],
|
||||
regions: [
|
||||
@0-3,
|
||||
@4-8,
|
||||
],
|
||||
space_before: [
|
||||
Slice(start = 0, length = 0),
|
||||
Slice(start = 0, length = 1),
|
||||
],
|
||||
space_after: [
|
||||
Slice(start = 0, length = 0),
|
||||
Slice(start = 1, length = 0),
|
||||
],
|
||||
spaces: [
|
||||
Newline,
|
||||
],
|
||||
type_defs: [
|
||||
Alias {
|
||||
header: TypeHeader {
|
||||
name: @4-5 "F",
|
||||
vars: [],
|
||||
},
|
||||
ann: @7-8 BoundVariable(
|
||||
"h",
|
||||
),
|
||||
},
|
||||
],
|
||||
value_defs: [
|
||||
Annotation(
|
||||
@0-1 Identifier(
|
||||
"a",
|
||||
),
|
||||
@2-3 Apply(
|
||||
"",
|
||||
"F",
|
||||
[],
|
||||
),
|
||||
),
|
||||
],
|
||||
},
|
||||
@9-12 SpaceBefore(
|
||||
Var {
|
||||
module_name: "",
|
||||
ident: "abc",
|
||||
},
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
)
|
|
@ -0,0 +1,4 @@
|
|||
a:F
|
||||
F
|
||||
:h
|
||||
abc
|
Loading…
Add table
Add a link
Reference in a new issue