lexer logic