docs: def _single_quote_handler_factory(on_single_quote, on_other):
      """Generates handlers used for classifying tokens that begin with one or more single quotes.
  
      Args:
          on_single_quote (callable): Called when another single quote is found. Accepts the current character's ordinal,
              the current context, and True if the token is a field name; returns a Transition.
          on_other (callable): Called when any character other than a single quote is found.  Accepts the current
              character's ordinal, the current context, and True if the token is a field name; returns a Transition.
      """
      @coroutine
      def single_quote_handler(c, ctx, is_field_name=False):
          assert c == _SINGLE_QUOTE
          c, self = yield
          if c == _SINGLE_QUOTE and not _is_escaped(c):
              yield on_single_quote(c, ctx, is_field_name)
          else:
              ctx.set_unicode(quoted_text=True)
              yield on_other(c, ctx, is_field_name)
      return single_quote_handler