By default, bad matches just kind of fall off the end. The parser gets derailed and returns partial results. Adding
finished to the end forces it to acknowledge the error. Hitting the 'Q' breaks
numbers out of its
many loop. The next parser in the chain is looking for an end-of-file marker, and instead it sees the 'Q'. Not the best error report though. Anyone who has used a compiler in the past 20 years generally expects to get a line and column of where the parse error occurred. Funcparserlib won't do this on its own, and it is probably why the original author is so fond of using Python's
token module as the first stage of parsing.
token will report more useful (but cryptic) information about where the error occurred. Worry about this later.