mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-04 04:08:19 +00:00
Several migration fixes and make some zig parser improvements based on migrated code in the wild (#7716)
This commit is contained in:
parent
68af4b9a06
commit
6d22c4dd7c
329 changed files with 1663 additions and 833 deletions
|
@ -5,6 +5,6 @@ O({p: if
|
|||
A
|
||||
} else {
|
||||
&m
|
||||
}}, #
|
||||
}} #
|
||||
) : e
|
||||
i
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
N((implements),h,(0),) : B
|
||||
N((implements), h, (0)) : B
|
||||
T
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
N(-0,T,) : A
|
||||
N(-0, T) : A
|
||||
zT
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
B(@A,) : w
|
||||
B(@A) : w
|
||||
#
|
||||
@A = e
|
||||
i
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
Zx((e #
|
||||
),f,) : i
|
||||
), f) : i
|
||||
s
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
U((b(a,)),) : b
|
||||
U((b(a))) : b
|
||||
a
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
M({s: s({J&
|
||||
},)},{s: s({J&
|
||||
},)},) : p
|
||||
})}, {s: s({J&
|
||||
})}) : p
|
||||
y
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
Q((
|
||||
"""
|
||||
"""("",)),) : a
|
||||
"""(""))) : a
|
||||
q
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
il3(|k| # w#z
|
||||
{
|
||||
CCC(@C,( # i
|
||||
t!(K,)),) : i
|
||||
CCC(@C, ( # i
|
||||
t!(K))) : i
|
||||
C
|
||||
},)
|
||||
})
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
M() :
|
||||
M :
|
||||
r
|
||||
h
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
A( #
|
||||
p,) : e
|
||||
p) : e
|
||||
A
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
K() : #
|
||||
K : #
|
||||
s
|
||||
K
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
O() : O(z,
|
||||
O : O(z
|
||||
#
|
||||
)
|
||||
b #
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
8: O(
|
||||
{
|
||||
},)
|
||||
})
|
||||
Q
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
foo: [True,Perhaps(Thing,),]
|
||||
foo: [True, Perhaps(Thing)]
|
||||
foo = True
|
||||
|
||||
42
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
launchTheNukes: {}, => Result(Bool,LaunchNukeErr,)
|
||||
launchTheNukes: {} => Result(Bool, LaunchNukeErr)
|
||||
launchTheNukes = |{}|
|
||||
crash("todo",)
|
||||
crash("todo")
|
||||
|
||||
launchTheNukes
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
x: a
|
||||
where
|
||||
e
|
||||
implements K, -> Z
|
||||
implements K -> Z
|
||||
s
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
H() : p
|
||||
H : p
|
||||
#
|
||||
s = p
|
||||
d #
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
{l: s, #
|
||||
{l: s #
|
||||
}: s
|
||||
o
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
k:
|
||||
[T,..m
|
||||
[T, ..m
|
||||
] #
|
||||
D
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
J() : [
|
||||
J : [
|
||||
] where e
|
||||
implements T
|
||||
i
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
1: (f,
|
||||
ww, -> p,..e)
|
||||
ww -> p, ..e)
|
||||
Mh
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{x,y,}: Foo
|
||||
{x,y,} = {x: "foo"y: 3.14}
|
||||
{x, y}: Foo
|
||||
{x, y} = {x: "foo", y: 3.14}
|
||||
|
||||
x
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
UserId(x,): [UserId(I64,),]
|
||||
UserId(x,) = UserId(42,)
|
||||
UserId(x): [UserId(I64)]
|
||||
UserId(x) = UserId(42)
|
||||
|
||||
x
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
(x,y,): Foo
|
||||
(x,y,) = ("foo",3.14,)
|
||||
(x, y): Foo
|
||||
(x, y) = ("foo", 3.14)
|
||||
|
||||
x
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
A(
|
||||
p,) :
|
||||
p) :
|
||||
e
|
||||
A
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
e: A #
|
||||
as H()
|
||||
as H
|
||||
n
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
A(
|
||||
e, # g
|
||||
e # g
|
||||
) : A
|
||||
AA
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
s: eas A()as A()
|
||||
s: eas Aas A
|
||||
s
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
g: [T(T, #
|
||||
),]
|
||||
g: [T(T #
|
||||
)]
|
||||
D
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
3: (..n #
|
||||
), -> n
|
||||
) -> n
|
||||
0
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
d: (J,..g
|
||||
d: (J, ..g
|
||||
)
|
||||
2
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
1: ((),..n)
|
||||
1: ((), ..n)
|
||||
l
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
Str.getUnsafe(haystack,haystackIndex,)
|
||||
==
|
||||
Str.getUnsafe(needle,needleIndex,)
|
||||
Str.getUnsafe(haystack, haystackIndex)
|
||||
==
|
||||
Str.getUnsafe(needle, needleIndex)
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
!!
|
||||
|w| 2(
|
||||
n,)
|
||||
n)
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
foo
|
||||
|> Dict.keepIf(|(k,_v,)| List.contains(keysToDelete,k,) |> Bool.not,)
|
||||
.(Dict.keepIf)(|(k, _v)| List.contains(keysToDelete, k).(Bool.not)())
|
||||
|
|
|
@ -1 +1 @@
|
|||
Whee((12),(34),)
|
||||
Whee((12), (34))
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
a: N({h
|
||||
},)
|
||||
})
|
||||
g
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
0({lxtl: (se #
|
||||
)},)
|
||||
0({l xt l: (se #
|
||||
)})
|
||||
|
|
|
@ -1 +1 @@
|
|||
Whee(12,34,)
|
||||
Whee(12, 34)
|
||||
|
|
|
@ -1 +1 @@
|
|||
Whee(12,34,)
|
||||
Whee(12, 34)
|
||||
|
|
|
@ -1 +1 @@
|
|||
Ok(a,)
|
||||
Ok(a)
|
||||
|
|
|
@ -1 +1 @@
|
|||
Ok(a,)
|
||||
Ok(a)
|
||||
|
|
|
@ -1 +1 @@
|
|||
a(b,c,d,)
|
||||
a(b, c, d)
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
i: M((),c,)
|
||||
i: M((), c)
|
||||
t
|
||||
|
|
|
@ -1 +1 @@
|
|||
whee(12,34,)
|
||||
whee(12, 34)
|
||||
|
|
|
@ -1 +1 @@
|
|||
whee(12,34,)
|
||||
whee(12, 34)
|
||||
|
|
|
@ -1 +1 @@
|
|||
-whee(12,foo,)
|
||||
-whee(12, foo)
|
||||
|
|
|
@ -1 +1 @@
|
|||
!whee(12,foo,)
|
||||
!whee(12, foo)
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
|{x,y,} as point@Location(inner,) as outer|
|
||||
crash("",)
|
||||
|{x, y} as point@Location(inner) as outer|
|
||||
crash("")
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
e: J
|
||||
as H(), -> A
|
||||
as H -> A
|
||||
r
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
J
|
||||
!
|
||||
.1(!.0,)
|
||||
.1(!.0)
|
||||
|
|
|
@ -1 +1 @@
|
|||
whee(1,)
|
||||
whee(1)
|
||||
|
|
|
@ -1 +1 @@
|
|||
(1,2,3,)
|
||||
(1, 2, 3)
|
||||
|
|
|
@ -1 +1 @@
|
|||
N < l((r * N),)
|
||||
N < l((r * N))
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
d +
|
||||
(|w| x)(
|
||||
x,)
|
||||
x)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
r ^
|
||||
-f(
|
||||
#
|
||||
-P,)
|
||||
-P)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
t =
|
||||
"""
|
||||
"
|
||||
"""("",)
|
||||
"""("")
|
||||
S
|
||||
|
|
|
@ -1 +1 @@
|
|||
launchTheNukes!(123,)
|
||||
launchTheNukes!(123)
|
||||
|
|
|
@ -1 +1 @@
|
|||
fxFn!(arg,)
|
||||
fxFn!(arg)
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
importP{_: h
|
||||
import P{_: h
|
||||
}
|
||||
|
||||
t!
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
|I({p? Y(
|
||||
Y,)?,},[
|
||||
],)|
|
||||
Y)?},[
|
||||
])|
|
||||
K # (
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
m0(|w| w?(e,),)
|
||||
/ s
|
||||
m0(|w| w?(e))
|
||||
/ s
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
|L(z,
|
||||
|L(z
|
||||
|
||||
)| 42
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
|{i, #
|
||||
e,}| a
|
||||
e}| a
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
m
|
||||
^ (-|w| m)(
|
||||
w,)
|
||||
^ (-|w| m)(
|
||||
w)
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
Model(position,) :
|
||||
{evaluated: Set(position,)
|
||||
openSet: Set(position,)
|
||||
costs: Dict.Dict(position,F64,)
|
||||
cameFrom: Dict.Dict(position,position,)
|
||||
Model(position) :
|
||||
{evaluated: Set(position),
|
||||
openSet: Set(position),
|
||||
costs: Dict.Dict(position, F64),
|
||||
cameFrom: Dict.Dict(position, position)
|
||||
}
|
||||
|
||||
a
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
F() : e #
|
||||
F : e #
|
||||
|
||||
q
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
dbg(l,) #
|
||||
dbg(l) #
|
||||
n
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
PP(P(@P(P(
|
||||
P(PPP(P(
|
||||
PPP,),
|
||||
),
|
||||
),
|
||||
PP(mport, # <|"P
|
||||
),),
|
||||
),),
|
||||
PPP)
|
||||
)
|
||||
),
|
||||
PP(mport # <|"P
|
||||
))
|
||||
))
|
||||
)
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
1: (M,b, # ,
|
||||
h, -> g,..e)
|
||||
1: (M, b, # ,
|
||||
h -> g, ..e)
|
||||
h
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
3 # test!
|
||||
+ 4
|
||||
+ 4
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
|L( #
|
||||
i,)| -e
|
||||
i)| -e
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
|LM( #
|
||||
Q,)| f8
|
||||
Q)| f8
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
1(0, #
|
||||
1(0 #
|
||||
#
|
||||
): gi
|
||||
M
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
3 # 2 × 2
|
||||
+ 4
|
||||
+ 4
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
x >
|
||||
x({
|
||||
|
||||
},) < r
|
||||
}) < r
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
_ = crash("",)
|
||||
_ = crash("","",)
|
||||
_ = crash(15,123,)
|
||||
_ = try(foo,(|_| crash("",)),)
|
||||
_ = crash("")
|
||||
_ = crash("", "")
|
||||
_ = crash(15, 123)
|
||||
_ = try(foo, (|_| crash("")))
|
||||
_ =
|
||||
{
|
||||
_ = crash("",)
|
||||
_ = crash("")
|
||||
crash
|
||||
}
|
||||
|
||||
{f: crash("",)}
|
||||
{f: crash("")}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
1(0( #
|
||||
0,),
|
||||
)(f,): f
|
||||
0)
|
||||
)(f): f
|
||||
t
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
1(ts(0,
|
||||
1(ts(0
|
||||
|
||||
#
|
||||
),
|
||||
)(f,): i7f
|
||||
)
|
||||
)(f): i7f
|
||||
e
|
||||
|
|
|
@ -3,4 +3,4 @@
|
|||
-
|
||||
"""
|
||||
"""()?
|
||||
}))(Y,)
|
||||
}))(Y)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
0(
|
||||
#
|
||||
f,): f
|
||||
f): f
|
||||
t
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
1: w, -> w, -> p
|
||||
1: w -> w -> p
|
||||
h
|
||||
|
|
|
@ -1 +1 @@
|
|||
dbg(1,)
|
||||
dbg(1)
|
||||
|
|
|
@ -1 +1 @@
|
|||
dbg(dbg,g,g,)
|
||||
dbg(dbg, g, g)
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
dbg(dbg,
|
||||
a,g,)
|
||||
a, g)
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
dbg(d,z,)
|
||||
dbg(d, z)
|
||||
dd
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
dbg(
|
||||
|
||||
izzb,
|
||||
interfacesb,)
|
||||
interfacesb)
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
dbg(a / a,)
|
||||
dbg(a / a)
|
||||
d
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
({
|
||||
(dbg(r,))
|
||||
(dbg(r))
|
||||
r
|
||||
})
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
dbg (5,
|
||||
666,)
|
||||
666)
|
||||
|
||||
4
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
dbg
|
||||
(q(
|
||||
qt,))
|
||||
qt))
|
||||
|
||||
g(
|
||||
qt,)
|
||||
qt)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
launchTheNukes! = |{}|
|
||||
boom
|
||||
|
||||
launchTheNukes!({},)
|
||||
launchTheNukes!({})
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
e =
|
||||
"""
|
||||
"""(a,)
|
||||
"""(a)
|
||||
p
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
main =
|
||||
{
|
||||
a = "Foo"
|
||||
Stdout.line?(a,)
|
||||
Stdout.line?(a)
|
||||
|
||||
printBar?
|
||||
}
|
||||
|
@ -9,5 +9,5 @@ main =
|
|||
printBar =
|
||||
{
|
||||
b = "Bar"
|
||||
Stdout.line(b,)
|
||||
Stdout.line(b)
|
||||
}
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
Email(str,) = Email("blah@example.com",)
|
||||
Email(str) = Email("blah@example.com")
|
||||
str
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
|j| e(|B
|
||||
| B,)
|
||||
> s
|
||||
| B)
|
||||
> s
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
1: (w, -> p,
|
||||
w, -> p,)
|
||||
1: (w -> p,
|
||||
w -> p)
|
||||
h
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
(0( #
|
||||
e,),0( #
|
||||
p,),): f
|
||||
e), 0( #
|
||||
p)): f
|
||||
t #
|
||||
|
|
|
@ -1 +1 @@
|
|||
get_name!({},) ?? "Bob"
|
||||
get_name!({}) ?? "Bob"
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue