goddamn writing a recursive descent parser is a lot harder when you wanna do good syntax error recovery
@eniko I realized it way too late, but in case you haven't thought about it yet: designing the syntax so that there are unambiguous toplevel bits helps a lot. "This thing has to start a new definition, so no matter the mess before, I know again where I am."
@nikodemus you mean like "func void foo(){}" instead of just "void foo(){}"?
@eniko even that can be handled if you don't mind having unbounded lookahead in the parser and check for "ident ident openparen". It's recovery, it can afford to be wrong in edge cases.