Skip to content

Commit 484c4f6

Browse files
anonriglemire
authored andcommitted
deps: update ada to v1.0.1
Co-authored-by: Daniel Lemire <[email protected]> PR-URL: #46550 Backport-PR-URL: #47435 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Gerhard Stöbich <[email protected]> Reviewed-By: Tiancheng "Timothy" Gu <[email protected]>
1 parent 958da45 commit 484c4f6

File tree

3 files changed

+36
-12
lines changed

3 files changed

+36
-12
lines changed

deps/ada/LICENSE-MIT

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
Copyright 2023 Ada authors
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy of
4+
this software and associated documentation files (the "Software"), to deal in
5+
the Software without restriction, including without limitation the rights to
6+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
7+
the Software, and to permit persons to whom the Software is furnished to do so,
8+
subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in all
11+
copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
15+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
16+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
17+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
18+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

deps/ada/ada.cpp

+10-9
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* auto-generated on 2023-02-06 08:25:59 -0500. Do not edit! */
1+
/* auto-generated on 2023-02-07 17:26:54 -0500. Do not edit! */
22
// dofile: invoked with prepath=/Users/yagiz/Developer/url-parser/src, filename=ada.cpp
33
/* begin file src/ada.cpp */
44
#include "ada.h"
@@ -970,6 +970,13 @@ namespace ada::helpers {
970970
} while (true);
971971
}
972972
}
973+
974+
ada_really_inline void strip_trailing_spaces_from_opaque_path(ada::url& url) noexcept {
975+
if (!url.has_opaque_path) return;
976+
if (url.fragment.has_value()) return;
977+
if (url.query.has_value()) return;
978+
while (!url.path.empty() && url.path.back() == ' ') { url.path.resize(url.path.size()-1); }
979+
}
973980
} // namespace ada::helpers
974981

975982
namespace ada {
@@ -1650,7 +1657,7 @@ namespace ada {
16501657
void url::set_hash(const std::string_view input) {
16511658
if (input.empty()) {
16521659
fragment = std::nullopt;
1653-
// TODO: Potentially strip trailing spaces from an opaque path with this.
1660+
helpers::strip_trailing_spaces_from_opaque_path(*this);
16541661
return;
16551662
}
16561663

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

@@ -1679,10 +1684,6 @@ namespace ada {
16791684
ada::character_sets::QUERY_PERCENT_ENCODE;
16801685

16811686
query = ada::unicode::percent_encode(std::string_view(new_value), query_percent_encode_set);
1682-
1683-
// Set this’s query object’s list to the result of parsing input.
1684-
// @todo Implement this if/when we have URLSearchParams.
1685-
return ;
16861687
}
16871688

16881689
bool url::set_pathname(const std::string_view input) {

deps/ada/ada.h

+8-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* auto-generated on 2023-02-06 08:25:59 -0500. Do not edit! */
1+
/* auto-generated on 2023-02-07 17:26:54 -0500. Do not edit! */
22
// dofile: invoked with prepath=/Users/yagiz/Developer/url-parser/include, filename=ada.h
33
/* begin file include/ada.h */
44
/**
@@ -1774,6 +1774,11 @@ namespace ada::helpers {
17741774
*/
17751775
ada_really_inline void trim_c0_whitespace(std::string_view& input) noexcept;
17761776

1777+
/**
1778+
* @see https://url.spec.whatwg.org/#potentially-strip-trailing-spaces-from-an-opaque-path
1779+
*/
1780+
ada_really_inline void strip_trailing_spaces_from_opaque_path(ada::url& url) noexcept;
1781+
17771782
} // namespace ada::helpers
17781783

17791784
#endif // ADA_HELPERS_H
@@ -4328,14 +4333,14 @@ namespace ada {
43284333
#ifndef ADA_ADA_VERSION_H
43294334
#define ADA_ADA_VERSION_H
43304335

4331-
#define ADA_VERSION "1.0.0"
4336+
#define ADA_VERSION "1.0.1"
43324337

43334338
namespace ada {
43344339

43354340
enum {
43364341
ADA_VERSION_MAJOR = 1,
43374342
ADA_VERSION_MINOR = 0,
4338-
ADA_VERSION_REVISION = 0,
4343+
ADA_VERSION_REVISION = 1,
43394344
};
43404345

43414346
} // namespace ada

0 commit comments

Comments
 (0)