Skip to content

Commit

Permalink
♻️ Use separator for sequence calls
Browse files Browse the repository at this point in the history
  • Loading branch information
MystPi committed Apr 24, 2024
1 parent 8caef68 commit b42d726
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/spark/parse.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -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([]),
)
Expand Down Expand Up @@ -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 <-)")
Expand Down

0 comments on commit b42d726

Please sign in to comment.