Skip to content

Commit

Permalink
Upgrade to ada 2.6.8, bump version to 1.4.1 (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
bbayles authored Sep 20, 2023
1 parent 74c9ab4 commit c9257fa
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 15 deletions.
9 changes: 4 additions & 5 deletions ada_url/ada.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* auto-generated on 2023-09-05 16:55:45 -0400. Do not edit! */
/* auto-generated on 2023-09-19 16:48:25 -0400. Do not edit! */
/* begin file src/ada.cpp */
#include "ada.h"
/* begin file src/checkers.cpp */
Expand Down Expand Up @@ -11864,7 +11864,7 @@ bool url::set_host_or_hostname(const std::string_view input) {
}

// Let host be the result of host parsing host_view with url is not special.
if (host_view.empty()) {
if (host_view.empty() && !is_special()) {
host = "";
return true;
}
Expand Down Expand Up @@ -13625,13 +13625,12 @@ bool url_aggregator::set_host_or_hostname(const std::string_view input) {
// empty string, and either url includes credentials or url's port is
// non-null, return.
else if (host_view.empty() &&
(is_special() || has_credentials() ||
components.port != url_components::omitted)) {
(is_special() || has_credentials() || has_port())) {
return false;
}

// Let host be the result of host parsing host_view with url is not special.
if (host_view.empty()) {
if (host_view.empty() && !is_special()) {
if (has_hostname()) {
clear_hostname(); // easy!
} else if (has_dash_dot()) {
Expand Down
21 changes: 12 additions & 9 deletions ada_url/ada.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* auto-generated on 2023-09-05 16:55:45 -0400. Do not edit! */
/* auto-generated on 2023-09-19 16:48:25 -0400. Do not edit! */
/* begin file include/ada.h */
/**
* @file ada.h
Expand Down Expand Up @@ -1055,9 +1055,10 @@ inline constexpr bool is_normalized_windows_drive_letter(
return input.size() >= 2 && (is_alpha(input[0]) && (input[1] == ':'));
}

ada_really_inline constexpr bool begins_with(std::string_view view,
std::string_view prefix) {
ada_really_inline bool begins_with(std::string_view view,
std::string_view prefix) {
// in C++20, you have view.begins_with(prefix)
// std::equal is constexpr in C++20
return view.size() >= prefix.size() &&
std::equal(prefix.begin(), prefix.end(), view.begin());
}
Expand Down Expand Up @@ -5020,10 +5021,10 @@ inline constexpr bool is_normalized_windows_drive_letter(
std::string_view input) noexcept;

/**
* @warning Will be removed when Ada supports C++20.
* @warning Will be removed when Ada requires C++20.
*/
ada_really_inline constexpr bool begins_with(std::string_view view,
std::string_view prefix);
ada_really_inline bool begins_with(std::string_view view,
std::string_view prefix);

/**
* Returns true if an input is an ipv4 address.
Expand Down Expand Up @@ -6557,7 +6558,9 @@ inline bool url_aggregator::has_hostname() const noexcept {

inline bool url_aggregator::has_port() const noexcept {
ada_log("url_aggregator::has_port");
return components.pathname_start != components.host_end;
// A URL cannot have a username/password/port if its host is null or the empty
// string, or its scheme is "file".
return has_hostname() && components.pathname_start != components.host_end;
}

inline bool url_aggregator::has_dash_dot() const noexcept {
Expand Down Expand Up @@ -6926,14 +6929,14 @@ inline void url_search_params::sort() {
#ifndef ADA_ADA_VERSION_H
#define ADA_ADA_VERSION_H

#define ADA_VERSION "2.6.7"
#define ADA_VERSION "2.6.8"

namespace ada {

enum {
ADA_VERSION_MAJOR = 2,
ADA_VERSION_MINOR = 6,
ADA_VERSION_REVISION = 7,
ADA_VERSION_REVISION = 8,
};

} // namespace ada
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = ada-url
version = 1.4.0
version = 1.4.1
description = 'URL parser and manipulator based on the WHAT WG URL standard'
long_description = file: README.rst
long_description_content_type = text/x-rst
Expand Down

0 comments on commit c9257fa

Please sign in to comment.