Skip to content

Commit 85e7424

Browse files
committed
chore: update ada to v2.6.1
1 parent 5f2b106 commit 85e7424

File tree

2 files changed

+104
-15
lines changed

2 files changed

+104
-15
lines changed

deps/ada.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* auto-generated on 2023-07-23 15:03:22 -0400. Do not edit! */
1+
/* auto-generated on 2023-08-21 14:44:25 -0400. Do not edit! */
22
/* begin file src/ada.cpp */
33
#include "ada.h"
44
/* begin file src/checkers.cpp */
@@ -12569,7 +12569,6 @@ result_type parse_url(std::string_view user_input,
1256912569
// If c is U+002F (/) and remaining starts with U+002F (/),
1257012570
// then set state to special authority ignore slashes state and increase
1257112571
// pointer by 1.
12572-
state = ada::state::SPECIAL_AUTHORITY_IGNORE_SLASHES;
1257312572
std::string_view view = helpers::substring(url_data, input_position);
1257412573
if (ada::checkers::begins_with(view, "//")) {
1257512574
input_position += 2;

deps/ada.h

Lines changed: 103 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* auto-generated on 2023-07-23 15:03:22 -0400. Do not edit! */
1+
/* auto-generated on 2023-08-21 14:44:25 -0400. Do not edit! */
22
/* begin file include/ada.h */
33
/**
44
* @file ada.h
@@ -1768,8 +1768,8 @@ inline int fast_digit_count(uint32_t x) noexcept {
17681768
#define TL_EXPECTED_HPP
17691769

17701770
#define TL_EXPECTED_VERSION_MAJOR 1
1771-
#define TL_EXPECTED_VERSION_MINOR 0
1772-
#define TL_EXPECTED_VERSION_PATCH 1
1771+
#define TL_EXPECTED_VERSION_MINOR 1
1772+
#define TL_EXPECTED_VERSION_PATCH 0
17731773

17741774
#include <exception>
17751775
#include <functional>
@@ -1802,6 +1802,16 @@ inline int fast_digit_count(uint32_t x) noexcept {
18021802
#define TL_EXPECTED_GCC55
18031803
#endif
18041804

1805+
#if !defined(TL_ASSERT)
1806+
// can't have assert in constexpr in C++11 and GCC 4.9 has a compiler bug
1807+
#if (__cplusplus > 201103L) && !defined(TL_EXPECTED_GCC49)
1808+
#include <cassert>
1809+
#define TL_ASSERT(x) assert(x)
1810+
#else
1811+
#define TL_ASSERT(x)
1812+
#endif
1813+
#endif
1814+
18051815
#if (defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ <= 9 && \
18061816
!defined(__clang__))
18071817
// GCC < 5 doesn't support overloading on const&& for member functions
@@ -1957,6 +1967,7 @@ template <typename E>
19571967
#ifdef TL_EXPECTED_EXCEPTIONS_ENABLED
19581968
throw std::forward<E>(e);
19591969
#else
1970+
(void)e;
19601971
#ifdef _MSC_VER
19611972
__assume(0);
19621973
#else
@@ -2597,7 +2608,7 @@ struct expected_operations_base : expected_storage_base<T, E> {
25972608
geterr().~unexpected<E>();
25982609
construct(std::move(rhs).get());
25992610
} else {
2600-
assign_common(rhs);
2611+
assign_common(std::move(rhs));
26012612
}
26022613
}
26032614

@@ -2960,7 +2971,7 @@ struct default_constructor_tag {
29602971
};
29612972

29622973
// expected_default_ctor_base will ensure that expected has a deleted default
2963-
// constructor if T is not default constructible.
2974+
// consturctor if T is not default constructible.
29642975
// This specialization is for when T is default constructible
29652976
template <class T, class E,
29662977
bool Enable =
@@ -3255,6 +3266,53 @@ class expected : private detail::expected_move_assign_base<T, E>,
32553266
return map_error_impl(std::move(*this), std::forward<F>(f));
32563267
}
32573268
#endif
3269+
#endif
3270+
#if defined(TL_EXPECTED_CXX14) && !defined(TL_EXPECTED_GCC49) && \
3271+
!defined(TL_EXPECTED_GCC54) && !defined(TL_EXPECTED_GCC55)
3272+
template <class F>
3273+
TL_EXPECTED_11_CONSTEXPR auto transform_error(F &&f) & {
3274+
return map_error_impl(*this, std::forward<F>(f));
3275+
}
3276+
template <class F>
3277+
TL_EXPECTED_11_CONSTEXPR auto transform_error(F &&f) && {
3278+
return map_error_impl(std::move(*this), std::forward<F>(f));
3279+
}
3280+
template <class F>
3281+
constexpr auto transform_error(F &&f) const & {
3282+
return map_error_impl(*this, std::forward<F>(f));
3283+
}
3284+
template <class F>
3285+
constexpr auto transform_error(F &&f) const && {
3286+
return map_error_impl(std::move(*this), std::forward<F>(f));
3287+
}
3288+
#else
3289+
template <class F>
3290+
TL_EXPECTED_11_CONSTEXPR decltype(map_error_impl(std::declval<expected &>(),
3291+
std::declval<F &&>()))
3292+
transform_error(F &&f) & {
3293+
return map_error_impl(*this, std::forward<F>(f));
3294+
}
3295+
template <class F>
3296+
TL_EXPECTED_11_CONSTEXPR decltype(map_error_impl(std::declval<expected &&>(),
3297+
std::declval<F &&>()))
3298+
transform_error(F &&f) && {
3299+
return map_error_impl(std::move(*this), std::forward<F>(f));
3300+
}
3301+
template <class F>
3302+
constexpr decltype(map_error_impl(std::declval<const expected &>(),
3303+
std::declval<F &&>()))
3304+
transform_error(F &&f) const & {
3305+
return map_error_impl(*this, std::forward<F>(f));
3306+
}
3307+
3308+
#ifndef TL_EXPECTED_NO_CONSTRR
3309+
template <class F>
3310+
constexpr decltype(map_error_impl(std::declval<const expected &&>(),
3311+
std::declval<F &&>()))
3312+
transform_error(F &&f) const && {
3313+
return map_error_impl(std::move(*this), std::forward<F>(f));
3314+
}
3315+
#endif
32583316
#endif
32593317
template <class F>
32603318
expected TL_EXPECTED_11_CONSTEXPR or_else(F &&f) & {
@@ -3697,27 +3755,37 @@ class expected : private detail::expected_move_assign_base<T, E>,
36973755
}
36983756
}
36993757

3700-
constexpr const T *operator->() const { return valptr(); }
3701-
TL_EXPECTED_11_CONSTEXPR T *operator->() { return valptr(); }
3758+
constexpr const T *operator->() const {
3759+
TL_ASSERT(has_value());
3760+
return valptr();
3761+
}
3762+
TL_EXPECTED_11_CONSTEXPR T *operator->() {
3763+
TL_ASSERT(has_value());
3764+
return valptr();
3765+
}
37023766

37033767
template <class U = T,
37043768
detail::enable_if_t<!std::is_void<U>::value> * = nullptr>
37053769
constexpr const U &operator*() const & {
3770+
TL_ASSERT(has_value());
37063771
return val();
37073772
}
37083773
template <class U = T,
37093774
detail::enable_if_t<!std::is_void<U>::value> * = nullptr>
37103775
TL_EXPECTED_11_CONSTEXPR U &operator*() & {
3776+
TL_ASSERT(has_value());
37113777
return val();
37123778
}
37133779
template <class U = T,
37143780
detail::enable_if_t<!std::is_void<U>::value> * = nullptr>
37153781
constexpr const U &&operator*() const && {
3782+
TL_ASSERT(has_value());
37163783
return std::move(val());
37173784
}
37183785
template <class U = T,
37193786
detail::enable_if_t<!std::is_void<U>::value> * = nullptr>
37203787
TL_EXPECTED_11_CONSTEXPR U &&operator*() && {
3788+
TL_ASSERT(has_value());
37213789
return std::move(val());
37223790
}
37233791

@@ -3753,10 +3821,22 @@ class expected : private detail::expected_move_assign_base<T, E>,
37533821
return std::move(val());
37543822
}
37553823

3756-
constexpr const E &error() const & { return err().value(); }
3757-
TL_EXPECTED_11_CONSTEXPR E &error() & { return err().value(); }
3758-
constexpr const E &&error() const && { return std::move(err().value()); }
3759-
TL_EXPECTED_11_CONSTEXPR E &&error() && { return std::move(err().value()); }
3824+
constexpr const E &error() const & {
3825+
TL_ASSERT(!has_value());
3826+
return err().value();
3827+
}
3828+
TL_EXPECTED_11_CONSTEXPR E &error() & {
3829+
TL_ASSERT(!has_value());
3830+
return err().value();
3831+
}
3832+
constexpr const E &&error() const && {
3833+
TL_ASSERT(!has_value());
3834+
return std::move(err().value());
3835+
}
3836+
TL_EXPECTED_11_CONSTEXPR E &&error() && {
3837+
TL_ASSERT(!has_value());
3838+
return std::move(err().value());
3839+
}
37603840

37613841
template <class U>
37623842
constexpr T value_or(U &&v) const & {
@@ -6609,6 +6689,7 @@ struct url_search_params {
66096689
* @see https://url.spec.whatwg.org/#dom-urlsearchparams-has
66106690
*/
66116691
inline bool has(std::string_view key) noexcept;
6692+
inline bool has(std::string_view key, std::string_view value) noexcept;
66126693

66136694
/**
66146695
* @see https://url.spec.whatwg.org/#dom-urlsearchparams-set
@@ -6733,6 +6814,15 @@ inline bool url_search_params::has(const std::string_view key) noexcept {
67336814
return entry != params.end();
67346815
}
67356816

6817+
inline bool url_search_params::has(std::string_view key,
6818+
std::string_view value) noexcept {
6819+
auto entry =
6820+
std::find_if(params.begin(), params.end(), [&key, &value](auto &param) {
6821+
return param.first == key && param.second == value;
6822+
});
6823+
return entry != params.end();
6824+
}
6825+
67366826
inline std::string url_search_params::to_string() {
67376827
auto character_set = ada::character_sets::WWW_FORM_URLENCODED_PERCENT_ENCODE;
67386828
std::string out{};
@@ -6807,14 +6897,14 @@ inline void url_search_params::sort() {
68076897
#ifndef ADA_ADA_VERSION_H
68086898
#define ADA_ADA_VERSION_H
68096899

6810-
#define ADA_VERSION "2.6.0"
6900+
#define ADA_VERSION "2.6.1"
68116901

68126902
namespace ada {
68136903

68146904
enum {
68156905
ADA_VERSION_MAJOR = 2,
68166906
ADA_VERSION_MINOR = 6,
6817-
ADA_VERSION_REVISION = 0,
6907+
ADA_VERSION_REVISION = 1,
68186908
};
68196909

68206910
} // namespace ada

0 commit comments

Comments
 (0)