mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-04 04:08:19 +00:00
Fix a bunch of bugs in parsing/formatting found by fuzzing
This commit is contained in:
parent
acd446f6bd
commit
3fee0d3e8f
43 changed files with 593 additions and 70 deletions
|
@ -0,0 +1,3 @@
|
|||
a
|
||||
&& (\x -> x)
|
||||
8
|
|
@ -0,0 +1,35 @@
|
|||
BinOps(
|
||||
[
|
||||
(
|
||||
@0-1 Var {
|
||||
module_name: "",
|
||||
ident: "a",
|
||||
},
|
||||
@2-4 And,
|
||||
),
|
||||
],
|
||||
@5-12 Apply(
|
||||
@5-10 Closure(
|
||||
[
|
||||
@6-7 Identifier(
|
||||
"x",
|
||||
),
|
||||
],
|
||||
@9-10 Var {
|
||||
module_name: "",
|
||||
ident: "x",
|
||||
},
|
||||
),
|
||||
[
|
||||
@11-12 SpaceBefore(
|
||||
Num(
|
||||
"8",
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
],
|
||||
Space,
|
||||
),
|
||||
)
|
|
@ -0,0 +1,2 @@
|
|||
a && \x->x
|
||||
8
|
|
@ -0,0 +1,4 @@
|
|||
i
|
||||
> (\s -> s
|
||||
)
|
||||
-a
|
|
@ -0,0 +1,39 @@
|
|||
BinOps(
|
||||
[
|
||||
(
|
||||
@0-1 Var {
|
||||
module_name: "",
|
||||
ident: "i",
|
||||
},
|
||||
@1-2 GreaterThan,
|
||||
),
|
||||
],
|
||||
@2-10 Apply(
|
||||
@2-7 SpaceAfter(
|
||||
Closure(
|
||||
[
|
||||
@3-4 Identifier(
|
||||
"s",
|
||||
),
|
||||
],
|
||||
@6-7 Var {
|
||||
module_name: "",
|
||||
ident: "s",
|
||||
},
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
[
|
||||
@8-10 UnaryOp(
|
||||
@9-10 Var {
|
||||
module_name: "",
|
||||
ident: "a",
|
||||
},
|
||||
@8-9 Negate,
|
||||
),
|
||||
],
|
||||
Space,
|
||||
),
|
||||
)
|
|
@ -0,0 +1,2 @@
|
|||
i>\s->s
|
||||
-a
|
|
@ -0,0 +1,3 @@
|
|||
B : {}
|
||||
|
||||
a
|
|
@ -0,0 +1,47 @@
|
|||
Defs(
|
||||
Defs {
|
||||
tags: [
|
||||
Index(0),
|
||||
],
|
||||
regions: [
|
||||
@0-4,
|
||||
],
|
||||
space_before: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
space_after: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
spaces: [],
|
||||
type_defs: [
|
||||
Alias {
|
||||
header: TypeHeader {
|
||||
name: @0-1 "B",
|
||||
vars: [],
|
||||
},
|
||||
ann: @2-4 Record {
|
||||
fields: [],
|
||||
ext: None,
|
||||
},
|
||||
},
|
||||
],
|
||||
value_defs: [],
|
||||
},
|
||||
@6-10 SpaceBefore(
|
||||
ParensAround(
|
||||
SpaceBefore(
|
||||
Var {
|
||||
module_name: "",
|
||||
ident: "a",
|
||||
},
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
)
|
|
@ -0,0 +1,4 @@
|
|||
B:{}
|
||||
|
||||
(
|
||||
a)
|
|
@ -1,3 +1,3 @@
|
|||
!
|
||||
"""
|
||||
"""
|
||||
-(
|
||||
"""
|
||||
""")
|
|
@ -4,5 +4,5 @@ UnaryOp(
|
|||
[],
|
||||
),
|
||||
),
|
||||
@0-1 Not,
|
||||
@0-1 Negate,
|
||||
)
|
||||
|
|
|
@ -1 +1 @@
|
|||
!""""""
|
||||
-""""""
|
|
@ -0,0 +1,4 @@
|
|||
-(
|
||||
"""
|
||||
"<
|
||||
""")
|
|
@ -0,0 +1,8 @@
|
|||
UnaryOp(
|
||||
@1-9 Str(
|
||||
PlainLine(
|
||||
"\"<",
|
||||
),
|
||||
),
|
||||
@0-1 Negate,
|
||||
)
|
|
@ -0,0 +1 @@
|
|||
-""""<"""
|
|
@ -0,0 +1,3 @@
|
|||
!
|
||||
"""
|
||||
"""
|
|
@ -0,0 +1,8 @@
|
|||
UnaryOp(
|
||||
@1-7 Str(
|
||||
Block(
|
||||
[],
|
||||
),
|
||||
),
|
||||
@0-1 Not,
|
||||
)
|
|
@ -0,0 +1 @@
|
|||
!""""""
|
|
@ -0,0 +1,2 @@
|
|||
U (b a) : b
|
||||
a
|
|
@ -0,0 +1,49 @@
|
|||
Defs(
|
||||
Defs {
|
||||
tags: [
|
||||
Index(0),
|
||||
],
|
||||
regions: [
|
||||
@0-8,
|
||||
],
|
||||
space_before: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
space_after: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
spaces: [],
|
||||
type_defs: [
|
||||
Alias {
|
||||
header: TypeHeader {
|
||||
name: @0-1 "U",
|
||||
vars: [
|
||||
@2-5 Apply(
|
||||
@2-3 Identifier(
|
||||
"b",
|
||||
),
|
||||
[
|
||||
@4-5 Identifier(
|
||||
"a",
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
},
|
||||
ann: @7-8 BoundVariable(
|
||||
"b",
|
||||
),
|
||||
},
|
||||
],
|
||||
value_defs: [],
|
||||
},
|
||||
@9-10 SpaceBefore(
|
||||
Var {
|
||||
module_name: "",
|
||||
ident: "a",
|
||||
},
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
)
|
|
@ -0,0 +1,2 @@
|
|||
U(b a):b
|
||||
a
|
|
@ -0,0 +1,3 @@
|
|||
i #
|
||||
N : b
|
||||
a
|
|
@ -0,0 +1,52 @@
|
|||
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: [
|
||||
Annotation(
|
||||
@0-1 Apply(
|
||||
@0-1 Identifier(
|
||||
"i",
|
||||
),
|
||||
[
|
||||
@5-6 SpaceBefore(
|
||||
Tag(
|
||||
"N",
|
||||
),
|
||||
[
|
||||
Newline,
|
||||
LineComment(
|
||||
"",
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
@8-9 BoundVariable(
|
||||
"b",
|
||||
),
|
||||
),
|
||||
],
|
||||
},
|
||||
@10-11 SpaceBefore(
|
||||
Var {
|
||||
module_name: "",
|
||||
ident: "a",
|
||||
},
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
)
|
|
@ -0,0 +1,4 @@
|
|||
i
|
||||
(#
|
||||
N):b
|
||||
a
|
|
@ -0,0 +1,2 @@
|
|||
D : b
|
||||
a
|
|
@ -0,0 +1,38 @@
|
|||
Defs(
|
||||
Defs {
|
||||
tags: [
|
||||
Index(0),
|
||||
],
|
||||
regions: [
|
||||
@1-5,
|
||||
],
|
||||
space_before: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
space_after: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
spaces: [],
|
||||
type_defs: [
|
||||
Alias {
|
||||
header: TypeHeader {
|
||||
name: @1-2 "D",
|
||||
vars: [],
|
||||
},
|
||||
ann: @4-5 BoundVariable(
|
||||
"b",
|
||||
),
|
||||
},
|
||||
],
|
||||
value_defs: [],
|
||||
},
|
||||
@6-7 SpaceBefore(
|
||||
Var {
|
||||
module_name: "",
|
||||
ident: "a",
|
||||
},
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
)
|
|
@ -0,0 +1,2 @@
|
|||
(D):b
|
||||
a
|
|
@ -0,0 +1,2 @@
|
|||
A : b
|
||||
a
|
|
@ -0,0 +1,38 @@
|
|||
Defs(
|
||||
Defs {
|
||||
tags: [
|
||||
Index(0),
|
||||
],
|
||||
regions: [
|
||||
@2-6,
|
||||
],
|
||||
space_before: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
space_after: [
|
||||
Slice(start = 0, length = 0),
|
||||
],
|
||||
spaces: [],
|
||||
type_defs: [
|
||||
Alias {
|
||||
header: TypeHeader {
|
||||
name: @2-3 "A",
|
||||
vars: [],
|
||||
},
|
||||
ann: @5-6 BoundVariable(
|
||||
"b",
|
||||
),
|
||||
},
|
||||
],
|
||||
value_defs: [],
|
||||
},
|
||||
@7-8 SpaceBefore(
|
||||
Var {
|
||||
module_name: "",
|
||||
ident: "a",
|
||||
},
|
||||
[
|
||||
Newline,
|
||||
],
|
||||
),
|
||||
)
|
|
@ -0,0 +1,3 @@
|
|||
(
|
||||
A):b
|
||||
a
|
|
@ -0,0 +1,5 @@
|
|||
"""
|
||||
|
||||
|
||||
#
|
||||
""" #
|
|
@ -0,0 +1,24 @@
|
|||
SpaceAfter(
|
||||
Str(
|
||||
Block(
|
||||
[
|
||||
[
|
||||
Plaintext(
|
||||
"\n",
|
||||
),
|
||||
Plaintext(
|
||||
"\n",
|
||||
),
|
||||
Plaintext(
|
||||
"#",
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
[
|
||||
LineComment(
|
||||
"",
|
||||
),
|
||||
],
|
||||
)
|
|
@ -0,0 +1,4 @@
|
|||
"""
|
||||
|
||||
|
||||
#"""#
|
Loading…
Add table
Add a link
Reference in a new issue