Skip to content
This repository was archived by the owner on Apr 2, 2026. It is now read-only.
Discussion options

You must be logged in to vote

It can still be done with what you are after, though you lose the benefit of .validate(..) allowing parsing to continue cleanly if an error occurs.

Description

While parsing the args, chumsky has 3 choices:

  • both
  • kw
  • pos

I'm going to try and explain how this happens in chumsky. If something is unclear in any or the steps, do let me know.

With that said, let's try each option:

both

So, it begins to parse both by parsing the list of positional args. However, due to the shared prefix chumsky parses the first identifier of kw as a pos. It attempts again to parse a pos. But because the next token : is neither an ident() nor a , it stops parsing the list of pos. It then attempts to parse a , wh…

Replies: 1 comment 12 replies

Comment options

You must be logged in to vote
12 replies
@jimmycuadra
Comment options

@Zij-IT
Comment options

@jimmycuadra
Comment options

@Zij-IT
Comment options

Answer selected by jimmycuadra
@jimmycuadra
Comment options

@Zij-IT
Comment options

@zesterer
Comment options

@jimmycuadra
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants