Tokens in the grammar being parsed includes multi-character keywords as well as identifiers of unknown length. Determining if the parse has failed due to invalid syntax or incomplete input is important.
There are a number of edge cases to consider and it seems that this type of thing should have been done before. Searching for ‘interruptible parser’ doesn’t provide much info. Is there another name for such a thing? What are some gotchas edge cases to be aware of?