more robust lexer