refactor `scan_ident` with length checks

want fix your TODO in lexer :p