Unterminated strings are never emitted by the lexer which means that the parser can't recover from it. Possible solution would be move the handling of unterminated strings to the parser which could then emit a string node with Unterminated flag set on it. This is what Pyright does as well.