Parse a version rule.  The first token is the name of the
    application implementing that API version.  The remaining tokens
    are key="quoted value" pairs that specify parameters; these
    parameters are ignored by AVersion, but may be used by the
    application.

    :param loader: An object with a get_app() method, which will be
                   used to load the actual applications.
    :param version: The version name.
    :param verspec: The version text, described above.

    :returns: A dictionary of three keys: "app" is the application;
              "name" is the version identification string; and
              "params" is a dictionary of parameters.

def _parse_version_rule(loader, version, verspec):
    """
    Parse a version rule.  The first token is the name of the
    application implementing that API version.  The remaining tokens
    are key="quoted value" pairs that specify parameters; these
    parameters are ignored by AVersion, but may be used by the
    application.

    :param loader: An object with a get_app() method, which will be
                   used to load the actual applications.
    :param version: The version name.
    :param verspec: The version text, described above.

    :returns: A dictionary of three keys: "app" is the application;
              "name" is the version identification string; and
              "params" is a dictionary of parameters.
    """

    result = dict(name=version, params={})
    for token in quoted_split(verspec, ' ', quotes='"\''):
        if not token:
            continue

        # Convert the application
        if 'app' not in result:
            result['app'] = loader.get_app(token)
            continue

        # What remains is key="quoted value" pairs...
        key, _eq, value = token.partition('=')

        # Set the parameter key
        _set_key('version.%s' % version, result['params'], key, value)

    # Make sure we have an application
    if 'app' not in result:
        raise ImportError("Cannot load application for version %r" % version)

    return result