From b42d7267b1e61aea8a31af6d4e951277e833ab5d Mon Sep 17 00:00:00 2001 From: MystPi <86574651+MystPi@users.noreply.github.com> Date: Wed, 24 Apr 2024 13:03:37 -0400 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Use=20`separator`=20for=20?= =?UTF-8?q?sequence=20calls?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/spark/parse.gleam | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/spark/parse.gleam b/src/spark/parse.gleam index 205d2b9..51f9d63 100644 --- a/src/spark/parse.gleam +++ b/src/spark/parse.gleam @@ -70,7 +70,7 @@ fn function() -> Parser(ast.Declaration) { ctx.InFunction(name), { use _ <- do(chomp.token(token.Backslash)) - sequence1(ident(), chomp.token(token.Comma)) + sequence1(ident(), separator(token.Comma)) } |> chomp.or([]), ) @@ -287,7 +287,7 @@ fn lambda_like() -> Parser(ast.Expression) { // of parameters, we have this intermediate parser so we don't have to use // backtracking. use _ <- do(chomp.token(token.Backslash)) - use parameters <- do(chomp.sequence(ident(), chomp.token(token.Comma))) + use parameters <- do(chomp.sequence(ident(), separator(token.Comma))) chomp.one_of([do_lambda(parameters), do_backpass(parameters)]) |> chomp.or_error("I expected a lambda or backpass (-> or <-)")