code: def something(TokenClass):
      
      def callback(lexer, match, context):
          text = match.group()
          if not text:
              return
          yield match.start(), TokenClass, text
          context.pos = match.end()
      return callback
docs: Do not produce empty tokens.