Added prototype error handling for the lexer