I encountered an interesting challenge while building a Lark parser for my domain-specific language, which I thought was worth a quick write-up. Details are below, but the TLDR is that making your grammar a little more complex by wrapping lists of rules into a new rule can simplify parsing. The Issue My language supports variable-length lists of notes that are optionally followed by a repeat symbol. In code, that looks like: