Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deps: update ada to v1.0.1 #46550

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 18 additions & 0 deletions deps/ada/LICENSE-MIT
@@ -0,0 +1,18 @@
Copyright 2023 Ada authors

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19 changes: 10 additions & 9 deletions deps/ada/ada.cpp
@@ -1,4 +1,4 @@
/* auto-generated on 2023-02-06 08:25:59 -0500. Do not edit! */
/* auto-generated on 2023-02-07 17:26:54 -0500. Do not edit! */
// dofile: invoked with prepath=/Users/yagiz/Developer/url-parser/src, filename=ada.cpp
/* begin file src/ada.cpp */
#include "ada.h"
Expand Down Expand Up @@ -970,6 +970,13 @@ namespace ada::helpers {
} while (true);
}
}

ada_really_inline void strip_trailing_spaces_from_opaque_path(ada::url& url) noexcept {
if (!url.has_opaque_path) return;
if (url.fragment.has_value()) return;
if (url.query.has_value()) return;
while (!url.path.empty() && url.path.back() == ' ') { url.path.resize(url.path.size()-1); }
}
} // namespace ada::helpers

namespace ada {
Expand Down Expand Up @@ -1650,7 +1657,7 @@ namespace ada {
void url::set_hash(const std::string_view input) {
if (input.empty()) {
fragment = std::nullopt;
// TODO: Potentially strip trailing spaces from an opaque path with this.
helpers::strip_trailing_spaces_from_opaque_path(*this);
return;
}

Expand All @@ -1664,9 +1671,7 @@ namespace ada {
void url::set_search(const std::string_view input) {
if (input.empty()) {
query = std::nullopt;
// Empty this’s query object’s list.
// @todo Implement this if/when we have URLSearchParams.
// Potentially strip trailing spaces from an opaque path with this.
helpers::strip_trailing_spaces_from_opaque_path(*this);
return;
}

Expand All @@ -1679,10 +1684,6 @@ namespace ada {
ada::character_sets::QUERY_PERCENT_ENCODE;

query = ada::unicode::percent_encode(std::string_view(new_value), query_percent_encode_set);

// Set this’s query object’s list to the result of parsing input.
// @todo Implement this if/when we have URLSearchParams.
return ;
}

bool url::set_pathname(const std::string_view input) {
Expand Down
11 changes: 8 additions & 3 deletions deps/ada/ada.h
@@ -1,4 +1,4 @@
/* auto-generated on 2023-02-06 08:25:59 -0500. Do not edit! */
/* auto-generated on 2023-02-07 17:26:54 -0500. Do not edit! */
// dofile: invoked with prepath=/Users/yagiz/Developer/url-parser/include, filename=ada.h
/* begin file include/ada.h */
/**
Expand Down Expand Up @@ -1774,6 +1774,11 @@ namespace ada::helpers {
*/
ada_really_inline void trim_c0_whitespace(std::string_view& input) noexcept;

/**
* @see https://url.spec.whatwg.org/#potentially-strip-trailing-spaces-from-an-opaque-path
*/
ada_really_inline void strip_trailing_spaces_from_opaque_path(ada::url& url) noexcept;

} // namespace ada::helpers

#endif // ADA_HELPERS_H
Expand Down Expand Up @@ -4328,14 +4333,14 @@ namespace ada {
#ifndef ADA_ADA_VERSION_H
#define ADA_ADA_VERSION_H

#define ADA_VERSION "1.0.0"
#define ADA_VERSION "1.0.1"

namespace ada {

enum {
ADA_VERSION_MAJOR = 1,
ADA_VERSION_MINOR = 0,
ADA_VERSION_REVISION = 0,
ADA_VERSION_REVISION = 1,
};

} // namespace ada
Expand Down
1 change: 0 additions & 1 deletion tools/dep_updaters/update-ada.sh 100644 → 100755
Expand Up @@ -34,7 +34,6 @@ echo "Fetching ada source archive..."
curl -sL -o "$ADA_ZIP" "https://github.com/ada-url/ada/releases/download/$ADA_REF/singleheader.zip"
unzip "$ADA_ZIP"
rm "$ADA_ZIP"
rm ./*_demo.cpp

curl -sL -o "$ADA_LICENSE" "https://raw.githubusercontent.com/ada-url/ada/HEAD/LICENSE-MIT"

Expand Down