mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
deps: update ada to 2.8.0
PR-URL: https://github.com/nodejs/node/pull/53254 Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
f302c2b7ee
commit
09868177d3
163
deps/ada/ada.cpp
vendored
163
deps/ada/ada.cpp
vendored
@ -1,4 +1,4 @@
|
||||
/* auto-generated on 2024-04-11 16:39:11 -0400. Do not edit! */
|
||||
/* auto-generated on 2024-05-30 22:24:57 -0400. Do not edit! */
|
||||
/* begin file src/ada.cpp */
|
||||
#include "ada.h"
|
||||
/* begin file src/checkers.cpp */
|
||||
@ -65,8 +65,7 @@ static constexpr std::array<uint8_t, 256> path_signature_table =
|
||||
std::array<uint8_t, 256> result{};
|
||||
for (size_t i = 0; i < 256; i++) {
|
||||
if (i <= 0x20 || i == 0x22 || i == 0x23 || i == 0x3c || i == 0x3e ||
|
||||
i == 0x3f || i == 0x60 || i == 0x7b || i == 0x7b || i == 0x7d ||
|
||||
i > 0x7e) {
|
||||
i == 0x3f || i == 0x60 || i == 0x7b || i == 0x7d || i > 0x7e) {
|
||||
result[i] = 1;
|
||||
} else if (i == 0x25) {
|
||||
result[i] = 8;
|
||||
@ -9839,24 +9838,34 @@ ada_really_inline bool has_tabs_or_newline(
|
||||
}
|
||||
// fast path for long strings (expected to be common)
|
||||
size_t i = 0;
|
||||
const uint8x16_t mask1 = vmovq_n_u8('\r');
|
||||
const uint8x16_t mask2 = vmovq_n_u8('\n');
|
||||
const uint8x16_t mask3 = vmovq_n_u8('\t');
|
||||
/**
|
||||
* The fastest way to check for `\t` (==9), '\n'(== 10) and `\r` (==13) relies
|
||||
* on table lookup instruction. We notice that these are all unique numbers
|
||||
* between 0..15. Let's prepare a special register, where we put '\t' in the
|
||||
* 9th position, '\n' - 10th and '\r' - 13th. Then we shuffle this register by
|
||||
* input register. If the input had `\t` in position X then this shuffled
|
||||
* register will also have '\t' in that position. Comparing input with this
|
||||
* shuffled register will mark us all interesting characters in the input.
|
||||
*
|
||||
* credit for algorithmic idea: @aqrit, credit for description:
|
||||
* @DenisYaroshevskiy
|
||||
*/
|
||||
static uint8_t rnt_array[16] = {1, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 9, 10, 0, 0, 13, 0, 0};
|
||||
const uint8x16_t rnt = vld1q_u8(rnt_array);
|
||||
// m['0xd', '0xa', '0x9']
|
||||
uint8x16_t running{0};
|
||||
for (; i + 15 < user_input.size(); i += 16) {
|
||||
uint8x16_t word = vld1q_u8((const uint8_t*)user_input.data() + i);
|
||||
running = vorrq_u8(vorrq_u8(running, vorrq_u8(vceqq_u8(word, mask1),
|
||||
vceqq_u8(word, mask2))),
|
||||
vceqq_u8(word, mask3));
|
||||
|
||||
running = vorrq_u8(running, vceqq_u8(vqtbl1q_u8(rnt, word), word));
|
||||
}
|
||||
if (i < user_input.size()) {
|
||||
uint8x16_t word =
|
||||
vld1q_u8((const uint8_t*)user_input.data() + user_input.length() - 16);
|
||||
running = vorrq_u8(vorrq_u8(running, vorrq_u8(vceqq_u8(word, mask1),
|
||||
vceqq_u8(word, mask2))),
|
||||
vceqq_u8(word, mask3));
|
||||
running = vorrq_u8(running, vceqq_u8(vqtbl1q_u8(rnt, word), word));
|
||||
}
|
||||
return vmaxvq_u8(running) != 0;
|
||||
return vmaxvq_u32(vreinterpretq_u32_u8(running)) != 0;
|
||||
}
|
||||
#elif ADA_SSE2
|
||||
ada_really_inline bool has_tabs_or_newline(
|
||||
@ -9876,6 +9885,7 @@ ada_really_inline bool has_tabs_or_newline(
|
||||
const __m128i mask1 = _mm_set1_epi8('\r');
|
||||
const __m128i mask2 = _mm_set1_epi8('\n');
|
||||
const __m128i mask3 = _mm_set1_epi8('\t');
|
||||
// If we supported SSSE3, we could use the algorithm that we use for NEON.
|
||||
__m128i running{0};
|
||||
for (; i + 15 < user_input.size(); i += 16) {
|
||||
__m128i word = _mm_loadu_si128((const __m128i*)(user_input.data() + i));
|
||||
@ -9898,7 +9908,7 @@ ada_really_inline bool has_tabs_or_newline(
|
||||
ada_really_inline bool has_tabs_or_newline(
|
||||
std::string_view user_input) noexcept {
|
||||
auto has_zero_byte = [](uint64_t v) {
|
||||
return ((v - 0x0101010101010101) & ~(v)&0x8080808080808080);
|
||||
return ((v - 0x0101010101010101) & ~(v) & 0x8080808080808080);
|
||||
};
|
||||
size_t i = 0;
|
||||
uint64_t mask1 = broadcast('\r');
|
||||
@ -10028,15 +10038,8 @@ contains_forbidden_domain_code_point_or_upper(const char* input,
|
||||
constexpr static std::array<bool, 256> is_alnum_plus_table = []() constexpr {
|
||||
std::array<bool, 256> result{};
|
||||
for (size_t c = 0; c < 256; c++) {
|
||||
if (c >= '0' && c <= '9') {
|
||||
result[c] = true;
|
||||
} else if (c >= 'a' && c <= 'z') {
|
||||
result[c] = true;
|
||||
} else if (c >= 'A' && c <= 'Z') {
|
||||
result[c] = true;
|
||||
} else if (c == '+' || c == '-' || c == '.') {
|
||||
result[c] = true;
|
||||
}
|
||||
result[c] = (c >= '0' && c <= '9') || (c >= 'a' && c <= 'z') ||
|
||||
(c >= 'A' && c <= 'Z') || c == '+' || c == '-' || c == '.';
|
||||
}
|
||||
return result;
|
||||
}();
|
||||
@ -10659,7 +10662,7 @@ ada_really_inline size_t find_next_host_delimiter_special(
|
||||
uint8x16_t lowpart = vqtbl1q_u8(low_mask, vandq_u8(word, fmask));
|
||||
uint8x16_t highpart = vqtbl1q_u8(high_mask, vshrq_n_u8(word, 4));
|
||||
uint8x16_t classify = vandq_u8(lowpart, highpart);
|
||||
if (vmaxvq_u8(classify) != 0) {
|
||||
if (vmaxvq_u32(vreinterpretq_u32_u8(classify)) != 0) {
|
||||
uint8x16_t is_zero = vceqq_u8(classify, zero);
|
||||
uint16_t is_non_zero = ~to_bitmask(is_zero);
|
||||
return i + trailing_zeroes(is_non_zero);
|
||||
@ -10672,7 +10675,7 @@ ada_really_inline size_t find_next_host_delimiter_special(
|
||||
uint8x16_t lowpart = vqtbl1q_u8(low_mask, vandq_u8(word, fmask));
|
||||
uint8x16_t highpart = vqtbl1q_u8(high_mask, vshrq_n_u8(word, 4));
|
||||
uint8x16_t classify = vandq_u8(lowpart, highpart);
|
||||
if (vmaxvq_u8(classify) != 0) {
|
||||
if (vmaxvq_u32(vreinterpretq_u32_u8(classify)) != 0) {
|
||||
uint8x16_t is_zero = vceqq_u8(classify, zero);
|
||||
uint16_t is_non_zero = ~to_bitmask(is_zero);
|
||||
return view.length() - 16 + trailing_zeroes(is_non_zero);
|
||||
@ -10797,7 +10800,7 @@ ada_really_inline size_t find_next_host_delimiter(std::string_view view,
|
||||
uint8x16_t lowpart = vqtbl1q_u8(low_mask, vandq_u8(word, fmask));
|
||||
uint8x16_t highpart = vqtbl1q_u8(high_mask, vshrq_n_u8(word, 4));
|
||||
uint8x16_t classify = vandq_u8(lowpart, highpart);
|
||||
if (vmaxvq_u8(classify) != 0) {
|
||||
if (vmaxvq_u32(vreinterpretq_u32_u8(classify)) != 0) {
|
||||
uint8x16_t is_zero = vceqq_u8(classify, zero);
|
||||
uint16_t is_non_zero = ~to_bitmask(is_zero);
|
||||
return i + trailing_zeroes(is_non_zero);
|
||||
@ -10810,7 +10813,7 @@ ada_really_inline size_t find_next_host_delimiter(std::string_view view,
|
||||
uint8x16_t lowpart = vqtbl1q_u8(low_mask, vandq_u8(word, fmask));
|
||||
uint8x16_t highpart = vqtbl1q_u8(high_mask, vshrq_n_u8(word, 4));
|
||||
uint8x16_t classify = vandq_u8(lowpart, highpart);
|
||||
if (vmaxvq_u8(classify) != 0) {
|
||||
if (vmaxvq_u32(vreinterpretq_u32_u8(classify)) != 0) {
|
||||
uint8x16_t is_zero = vceqq_u8(classify, zero);
|
||||
uint16_t is_non_zero = ~to_bitmask(is_zero);
|
||||
return view.length() - 16 + trailing_zeroes(is_non_zero);
|
||||
@ -11164,7 +11167,7 @@ ada_really_inline void strip_trailing_spaces_from_opaque_path(
|
||||
static constexpr std::array<uint8_t, 256> authority_delimiter_special =
|
||||
[]() constexpr {
|
||||
std::array<uint8_t, 256> result{};
|
||||
for (int i : {'@', '/', '\\', '?'}) {
|
||||
for (uint8_t i : {'@', '/', '\\', '?'}) {
|
||||
result[i] = 1;
|
||||
}
|
||||
return result;
|
||||
@ -11185,7 +11188,7 @@ find_authority_delimiter_special(std::string_view view) noexcept {
|
||||
// @ / ?
|
||||
static constexpr std::array<uint8_t, 256> authority_delimiter = []() constexpr {
|
||||
std::array<uint8_t, 256> result{};
|
||||
for (int i : {'@', '/', '?'}) {
|
||||
for (uint8_t i : {'@', '/', '?'}) {
|
||||
result[i] = 1;
|
||||
}
|
||||
return result;
|
||||
@ -11255,7 +11258,7 @@ bool url::parse_ipv4(std::string_view input) {
|
||||
segment_result = 0;
|
||||
input.remove_prefix(2);
|
||||
} else {
|
||||
std::from_chars_result r;
|
||||
std::from_chars_result r{};
|
||||
if (is_hex) {
|
||||
r = std::from_chars(input.data() + 2, input.data() + input.size(),
|
||||
segment_result, 16);
|
||||
@ -11809,7 +11812,6 @@ ada_really_inline void url::parse_path(std::string_view input) {
|
||||
* Includes all the getters of `ada::url`
|
||||
*/
|
||||
|
||||
#include <algorithm>
|
||||
#include <string>
|
||||
|
||||
namespace ada {
|
||||
@ -12058,7 +12060,6 @@ void url::set_hash(const std::string_view input) {
|
||||
helpers::remove_ascii_tab_or_newline(new_value);
|
||||
hash = unicode::percent_encode(new_value,
|
||||
ada::character_sets::FRAGMENT_PERCENT_ENCODE);
|
||||
return;
|
||||
}
|
||||
|
||||
void url::set_search(const std::string_view input) {
|
||||
@ -12136,7 +12137,6 @@ bool url::set_href(const std::string_view input) {
|
||||
/* end file src/url-setters.cpp */
|
||||
/* begin file src/parser.cpp */
|
||||
|
||||
#include <numeric>
|
||||
#include <limits>
|
||||
|
||||
namespace ada::parser {
|
||||
@ -13121,7 +13121,6 @@ namespace ada {
|
||||
if (hash_start < index) {
|
||||
return false;
|
||||
}
|
||||
index = hash_start;
|
||||
}
|
||||
|
||||
return true;
|
||||
@ -13479,7 +13478,7 @@ bool url_aggregator::set_pathname(const std::string_view input) {
|
||||
}
|
||||
clear_pathname();
|
||||
parse_path(input);
|
||||
if (checkers::begins_with(input, "//") && !has_authority() &&
|
||||
if (checkers::begins_with(get_pathname(), "//") && !has_authority() &&
|
||||
!has_dash_dot()) {
|
||||
buffer.insert(components.pathname_start, "/.");
|
||||
components.pathname_start += 2;
|
||||
@ -13863,7 +13862,7 @@ bool url_aggregator::set_hostname(const std::string_view input) {
|
||||
// if we have an empty host, then the space between components.host_end and
|
||||
// components.pathname_start may be occupied by /.
|
||||
if (start == components.host_end) {
|
||||
return std::string_view();
|
||||
return {};
|
||||
}
|
||||
return helpers::substring(buffer, start, components.pathname_start);
|
||||
}
|
||||
@ -13887,7 +13886,7 @@ bool url_aggregator::set_hostname(const std::string_view input) {
|
||||
components.pathname_start, " buffer.size() = ", buffer.size(),
|
||||
" components.search_start = ", components.search_start,
|
||||
" components.hash_start = ", components.hash_start);
|
||||
uint32_t ending_index = uint32_t(buffer.size());
|
||||
auto ending_index = uint32_t(buffer.size());
|
||||
if (components.search_start != url_components::omitted) {
|
||||
ending_index = components.search_start;
|
||||
} else if (components.hash_start != url_components::omitted) {
|
||||
@ -13903,7 +13902,7 @@ bool url_aggregator::set_hostname(const std::string_view input) {
|
||||
if (components.search_start == url_components::omitted) {
|
||||
return "";
|
||||
}
|
||||
uint32_t ending_index = uint32_t(buffer.size());
|
||||
auto ending_index = uint32_t(buffer.size());
|
||||
if (components.hash_start != url_components::omitted) {
|
||||
ending_index = components.hash_start;
|
||||
}
|
||||
@ -14041,7 +14040,7 @@ bool url_aggregator::parse_ipv4(std::string_view input, bool in_place) {
|
||||
segment_result = 0;
|
||||
input.remove_prefix(2);
|
||||
} else {
|
||||
std::from_chars_result r;
|
||||
std::from_chars_result r{};
|
||||
if (is_hex) {
|
||||
ada_log("parse_ipv4 trying to parse hex number");
|
||||
r = std::from_chars(input.data() + 2, input.data() + input.size(),
|
||||
@ -14988,8 +14987,7 @@ bool ada_can_parse_with_base(const char* input, size_t input_length,
|
||||
}
|
||||
|
||||
void ada_free(ada_url result) noexcept {
|
||||
ada::result<ada::url_aggregator>* r =
|
||||
(ada::result<ada::url_aggregator>*)result;
|
||||
auto* r = (ada::result<ada::url_aggregator>*)result;
|
||||
delete r;
|
||||
}
|
||||
|
||||
@ -15006,7 +15004,7 @@ bool ada_is_valid(ada_url result) noexcept {
|
||||
// caller must free the result with ada_free_owned_string
|
||||
ada_owned_string ada_get_origin(ada_url result) noexcept {
|
||||
ada::result<ada::url_aggregator>& r = get_instance(result);
|
||||
ada_owned_string owned;
|
||||
ada_owned_string owned{};
|
||||
if (!r) {
|
||||
owned.data = nullptr;
|
||||
owned.length = 0;
|
||||
@ -15021,14 +15019,12 @@ ada_owned_string ada_get_origin(ada_url result) noexcept {
|
||||
|
||||
void ada_free_owned_string(ada_owned_string owned) noexcept {
|
||||
delete[] owned.data;
|
||||
owned.data = nullptr;
|
||||
owned.length = 0;
|
||||
}
|
||||
|
||||
ada_string ada_get_href(ada_url result) noexcept {
|
||||
ada::result<ada::url_aggregator>& r = get_instance(result);
|
||||
if (!r) {
|
||||
return ada_string_create(NULL, 0);
|
||||
return ada_string_create(nullptr, 0);
|
||||
}
|
||||
std::string_view out = r->get_href();
|
||||
return ada_string_create(out.data(), out.length());
|
||||
@ -15037,7 +15033,7 @@ ada_string ada_get_href(ada_url result) noexcept {
|
||||
ada_string ada_get_username(ada_url result) noexcept {
|
||||
ada::result<ada::url_aggregator>& r = get_instance(result);
|
||||
if (!r) {
|
||||
return ada_string_create(NULL, 0);
|
||||
return ada_string_create(nullptr, 0);
|
||||
}
|
||||
std::string_view out = r->get_username();
|
||||
return ada_string_create(out.data(), out.length());
|
||||
@ -15046,7 +15042,7 @@ ada_string ada_get_username(ada_url result) noexcept {
|
||||
ada_string ada_get_password(ada_url result) noexcept {
|
||||
ada::result<ada::url_aggregator>& r = get_instance(result);
|
||||
if (!r) {
|
||||
return ada_string_create(NULL, 0);
|
||||
return ada_string_create(nullptr, 0);
|
||||
}
|
||||
std::string_view out = r->get_password();
|
||||
return ada_string_create(out.data(), out.length());
|
||||
@ -15055,7 +15051,7 @@ ada_string ada_get_password(ada_url result) noexcept {
|
||||
ada_string ada_get_port(ada_url result) noexcept {
|
||||
ada::result<ada::url_aggregator>& r = get_instance(result);
|
||||
if (!r) {
|
||||
return ada_string_create(NULL, 0);
|
||||
return ada_string_create(nullptr, 0);
|
||||
}
|
||||
std::string_view out = r->get_port();
|
||||
return ada_string_create(out.data(), out.length());
|
||||
@ -15064,7 +15060,7 @@ ada_string ada_get_port(ada_url result) noexcept {
|
||||
ada_string ada_get_hash(ada_url result) noexcept {
|
||||
ada::result<ada::url_aggregator>& r = get_instance(result);
|
||||
if (!r) {
|
||||
return ada_string_create(NULL, 0);
|
||||
return ada_string_create(nullptr, 0);
|
||||
}
|
||||
std::string_view out = r->get_hash();
|
||||
return ada_string_create(out.data(), out.length());
|
||||
@ -15073,7 +15069,7 @@ ada_string ada_get_hash(ada_url result) noexcept {
|
||||
ada_string ada_get_host(ada_url result) noexcept {
|
||||
ada::result<ada::url_aggregator>& r = get_instance(result);
|
||||
if (!r) {
|
||||
return ada_string_create(NULL, 0);
|
||||
return ada_string_create(nullptr, 0);
|
||||
}
|
||||
std::string_view out = r->get_host();
|
||||
return ada_string_create(out.data(), out.length());
|
||||
@ -15082,7 +15078,7 @@ ada_string ada_get_host(ada_url result) noexcept {
|
||||
ada_string ada_get_hostname(ada_url result) noexcept {
|
||||
ada::result<ada::url_aggregator>& r = get_instance(result);
|
||||
if (!r) {
|
||||
return ada_string_create(NULL, 0);
|
||||
return ada_string_create(nullptr, 0);
|
||||
}
|
||||
std::string_view out = r->get_hostname();
|
||||
return ada_string_create(out.data(), out.length());
|
||||
@ -15091,7 +15087,7 @@ ada_string ada_get_hostname(ada_url result) noexcept {
|
||||
ada_string ada_get_pathname(ada_url result) noexcept {
|
||||
ada::result<ada::url_aggregator>& r = get_instance(result);
|
||||
if (!r) {
|
||||
return ada_string_create(NULL, 0);
|
||||
return ada_string_create(nullptr, 0);
|
||||
}
|
||||
std::string_view out = r->get_pathname();
|
||||
return ada_string_create(out.data(), out.length());
|
||||
@ -15100,7 +15096,7 @@ ada_string ada_get_pathname(ada_url result) noexcept {
|
||||
ada_string ada_get_search(ada_url result) noexcept {
|
||||
ada::result<ada::url_aggregator>& r = get_instance(result);
|
||||
if (!r) {
|
||||
return ada_string_create(NULL, 0);
|
||||
return ada_string_create(nullptr, 0);
|
||||
}
|
||||
std::string_view out = r->get_search();
|
||||
return ada_string_create(out.data(), out.length());
|
||||
@ -15109,7 +15105,7 @@ ada_string ada_get_search(ada_url result) noexcept {
|
||||
ada_string ada_get_protocol(ada_url result) noexcept {
|
||||
ada::result<ada::url_aggregator>& r = get_instance(result);
|
||||
if (!r) {
|
||||
return ada_string_create(NULL, 0);
|
||||
return ada_string_create(nullptr, 0);
|
||||
}
|
||||
std::string_view out = r->get_protocol();
|
||||
return ada_string_create(out.data(), out.length());
|
||||
@ -15368,15 +15364,14 @@ ada_url_search_params ada_parse_search_params(const char* input,
|
||||
}
|
||||
|
||||
void ada_free_search_params(ada_url_search_params result) {
|
||||
ada::result<ada::url_search_params>* r =
|
||||
(ada::result<ada::url_search_params>*)result;
|
||||
auto* r = (ada::result<ada::url_search_params>*)result;
|
||||
delete r;
|
||||
}
|
||||
|
||||
ada_owned_string ada_search_params_to_string(ada_url_search_params result) {
|
||||
ada::result<ada::url_search_params>& r =
|
||||
*(ada::result<ada::url_search_params>*)result;
|
||||
if (!r) return ada_owned_string{NULL, 0};
|
||||
if (!r) return ada_owned_string{nullptr, 0};
|
||||
std::string out = r->to_string();
|
||||
ada_owned_string owned{};
|
||||
owned.length = out.size();
|
||||
@ -15471,11 +15466,11 @@ ada_string ada_search_params_get(ada_url_search_params result, const char* key,
|
||||
ada::result<ada::url_search_params>& r =
|
||||
*(ada::result<ada::url_search_params>*)result;
|
||||
if (!r) {
|
||||
return ada_string_create(NULL, 0);
|
||||
return ada_string_create(nullptr, 0);
|
||||
}
|
||||
auto found = r->get(std::string_view(key, key_length));
|
||||
if (!found.has_value()) {
|
||||
return ada_string_create(NULL, 0);
|
||||
return ada_string_create(nullptr, 0);
|
||||
}
|
||||
return ada_string_create(found->data(), found->length());
|
||||
}
|
||||
@ -15526,14 +15521,12 @@ ada_url_search_params_entries_iter ada_search_params_get_entries(
|
||||
}
|
||||
|
||||
void ada_free_strings(ada_strings result) {
|
||||
ada::result<std::vector<std::string>>* r =
|
||||
(ada::result<std::vector<std::string>>*)result;
|
||||
auto* r = (ada::result<std::vector<std::string>>*)result;
|
||||
delete r;
|
||||
}
|
||||
|
||||
size_t ada_strings_size(ada_strings result) {
|
||||
ada::result<std::vector<std::string>>* r =
|
||||
(ada::result<std::vector<std::string>>*)result;
|
||||
auto* r = (ada::result<std::vector<std::string>>*)result;
|
||||
if (!r) {
|
||||
return 0;
|
||||
}
|
||||
@ -15541,39 +15534,35 @@ size_t ada_strings_size(ada_strings result) {
|
||||
}
|
||||
|
||||
ada_string ada_strings_get(ada_strings result, size_t index) {
|
||||
ada::result<std::vector<std::string>>* r =
|
||||
(ada::result<std::vector<std::string>>*)result;
|
||||
auto* r = (ada::result<std::vector<std::string>>*)result;
|
||||
if (!r) {
|
||||
return ada_string_create(NULL, 0);
|
||||
return ada_string_create(nullptr, 0);
|
||||
}
|
||||
std::string_view view = (*r)->at(index);
|
||||
return ada_string_create(view.data(), view.length());
|
||||
}
|
||||
|
||||
void ada_free_search_params_keys_iter(ada_url_search_params_keys_iter result) {
|
||||
ada::result<ada::url_search_params_keys_iter>* r =
|
||||
(ada::result<ada::url_search_params_keys_iter>*)result;
|
||||
auto* r = (ada::result<ada::url_search_params_keys_iter>*)result;
|
||||
delete r;
|
||||
}
|
||||
|
||||
ada_string ada_search_params_keys_iter_next(
|
||||
ada_url_search_params_keys_iter result) {
|
||||
ada::result<ada::url_search_params_keys_iter>* r =
|
||||
(ada::result<ada::url_search_params_keys_iter>*)result;
|
||||
auto* r = (ada::result<ada::url_search_params_keys_iter>*)result;
|
||||
if (!r) {
|
||||
return ada_string_create(NULL, 0);
|
||||
return ada_string_create(nullptr, 0);
|
||||
}
|
||||
auto next = (*r)->next();
|
||||
if (!next.has_value()) {
|
||||
return ada_string_create(NULL, 0);
|
||||
return ada_string_create(nullptr, 0);
|
||||
}
|
||||
return ada_string_create(next->data(), next->length());
|
||||
}
|
||||
|
||||
bool ada_search_params_keys_iter_has_next(
|
||||
ada_url_search_params_keys_iter result) {
|
||||
ada::result<ada::url_search_params_keys_iter>* r =
|
||||
(ada::result<ada::url_search_params_keys_iter>*)result;
|
||||
auto* r = (ada::result<ada::url_search_params_keys_iter>*)result;
|
||||
if (!r) {
|
||||
return false;
|
||||
}
|
||||
@ -15582,29 +15571,26 @@ bool ada_search_params_keys_iter_has_next(
|
||||
|
||||
void ada_free_search_params_values_iter(
|
||||
ada_url_search_params_values_iter result) {
|
||||
ada::result<ada::url_search_params_values_iter>* r =
|
||||
(ada::result<ada::url_search_params_values_iter>*)result;
|
||||
auto* r = (ada::result<ada::url_search_params_values_iter>*)result;
|
||||
delete r;
|
||||
}
|
||||
|
||||
ada_string ada_search_params_values_iter_next(
|
||||
ada_url_search_params_values_iter result) {
|
||||
ada::result<ada::url_search_params_values_iter>* r =
|
||||
(ada::result<ada::url_search_params_values_iter>*)result;
|
||||
auto* r = (ada::result<ada::url_search_params_values_iter>*)result;
|
||||
if (!r) {
|
||||
return ada_string_create(NULL, 0);
|
||||
return ada_string_create(nullptr, 0);
|
||||
}
|
||||
auto next = (*r)->next();
|
||||
if (!next.has_value()) {
|
||||
return ada_string_create(NULL, 0);
|
||||
return ada_string_create(nullptr, 0);
|
||||
}
|
||||
return ada_string_create(next->data(), next->length());
|
||||
}
|
||||
|
||||
bool ada_search_params_values_iter_has_next(
|
||||
ada_url_search_params_values_iter result) {
|
||||
ada::result<ada::url_search_params_values_iter>* r =
|
||||
(ada::result<ada::url_search_params_values_iter>*)result;
|
||||
auto* r = (ada::result<ada::url_search_params_values_iter>*)result;
|
||||
if (!r) {
|
||||
return false;
|
||||
}
|
||||
@ -15613,19 +15599,17 @@ bool ada_search_params_values_iter_has_next(
|
||||
|
||||
void ada_free_search_params_entries_iter(
|
||||
ada_url_search_params_entries_iter result) {
|
||||
ada::result<ada::url_search_params_entries_iter>* r =
|
||||
(ada::result<ada::url_search_params_entries_iter>*)result;
|
||||
auto* r = (ada::result<ada::url_search_params_entries_iter>*)result;
|
||||
delete r;
|
||||
}
|
||||
|
||||
ada_string_pair ada_search_params_entries_iter_next(
|
||||
ada_url_search_params_entries_iter result) {
|
||||
ada::result<ada::url_search_params_entries_iter>* r =
|
||||
(ada::result<ada::url_search_params_entries_iter>*)result;
|
||||
if (!r) return {ada_string_create(NULL, 0), ada_string_create(NULL, 0)};
|
||||
auto* r = (ada::result<ada::url_search_params_entries_iter>*)result;
|
||||
if (!r) return {ada_string_create(nullptr, 0), ada_string_create(nullptr, 0)};
|
||||
auto next = (*r)->next();
|
||||
if (!next.has_value()) {
|
||||
return {ada_string_create(NULL, 0), ada_string_create(NULL, 0)};
|
||||
return {ada_string_create(nullptr, 0), ada_string_create(nullptr, 0)};
|
||||
}
|
||||
return ada_string_pair{
|
||||
ada_string_create(next->first.data(), next->first.length()),
|
||||
@ -15634,8 +15618,7 @@ ada_string_pair ada_search_params_entries_iter_next(
|
||||
|
||||
bool ada_search_params_entries_iter_has_next(
|
||||
ada_url_search_params_entries_iter result) {
|
||||
ada::result<ada::url_search_params_entries_iter>* r =
|
||||
(ada::result<ada::url_search_params_entries_iter>*)result;
|
||||
auto* r = (ada::result<ada::url_search_params_entries_iter>*)result;
|
||||
if (!r) {
|
||||
return false;
|
||||
}
|
||||
|
154
deps/ada/ada.h
vendored
154
deps/ada/ada.h
vendored
@ -1,4 +1,4 @@
|
||||
/* auto-generated on 2024-04-11 16:39:11 -0400. Do not edit! */
|
||||
/* auto-generated on 2024-05-30 22:24:57 -0400. Do not edit! */
|
||||
/* begin file include/ada.h */
|
||||
/**
|
||||
* @file ada.h
|
||||
@ -1214,25 +1214,104 @@ namespace ada {
|
||||
* @see https://url.spec.whatwg.org/#url-parsing
|
||||
*/
|
||||
enum class state {
|
||||
/**
|
||||
* @see https://url.spec.whatwg.org/#authority-state
|
||||
*/
|
||||
AUTHORITY,
|
||||
|
||||
/**
|
||||
* @see https://url.spec.whatwg.org/#scheme-start-state
|
||||
*/
|
||||
SCHEME_START,
|
||||
|
||||
/**
|
||||
* @see https://url.spec.whatwg.org/#scheme-state
|
||||
*/
|
||||
SCHEME,
|
||||
|
||||
/**
|
||||
* @see https://url.spec.whatwg.org/#host-state
|
||||
*/
|
||||
HOST,
|
||||
|
||||
/**
|
||||
* @see https://url.spec.whatwg.org/#no-scheme-state
|
||||
*/
|
||||
NO_SCHEME,
|
||||
|
||||
/**
|
||||
* @see https://url.spec.whatwg.org/#fragment-state
|
||||
*/
|
||||
FRAGMENT,
|
||||
|
||||
/**
|
||||
* @see https://url.spec.whatwg.org/#relative-state
|
||||
*/
|
||||
RELATIVE_SCHEME,
|
||||
|
||||
/**
|
||||
* @see https://url.spec.whatwg.org/#relative-slash-state
|
||||
*/
|
||||
RELATIVE_SLASH,
|
||||
|
||||
/**
|
||||
* @see https://url.spec.whatwg.org/#file-state
|
||||
*/
|
||||
FILE,
|
||||
|
||||
/**
|
||||
* @see https://url.spec.whatwg.org/#file-host-state
|
||||
*/
|
||||
FILE_HOST,
|
||||
|
||||
/**
|
||||
* @see https://url.spec.whatwg.org/#file-slash-state
|
||||
*/
|
||||
FILE_SLASH,
|
||||
|
||||
/**
|
||||
* @see https://url.spec.whatwg.org/#path-or-authority-state
|
||||
*/
|
||||
PATH_OR_AUTHORITY,
|
||||
|
||||
/**
|
||||
* @see https://url.spec.whatwg.org/#special-authority-ignore-slashes-state
|
||||
*/
|
||||
SPECIAL_AUTHORITY_IGNORE_SLASHES,
|
||||
|
||||
/**
|
||||
* @see https://url.spec.whatwg.org/#special-authority-slashes-state
|
||||
*/
|
||||
SPECIAL_AUTHORITY_SLASHES,
|
||||
|
||||
/**
|
||||
* @see https://url.spec.whatwg.org/#special-relative-or-authority-state
|
||||
*/
|
||||
SPECIAL_RELATIVE_OR_AUTHORITY,
|
||||
|
||||
/**
|
||||
* @see https://url.spec.whatwg.org/#query-state
|
||||
*/
|
||||
QUERY,
|
||||
|
||||
/**
|
||||
* @see https://url.spec.whatwg.org/#path-state
|
||||
*/
|
||||
PATH,
|
||||
|
||||
/**
|
||||
* @see https://url.spec.whatwg.org/#path-start-state
|
||||
*/
|
||||
PATH_START,
|
||||
|
||||
/**
|
||||
* @see https://url.spec.whatwg.org/#cannot-be-a-base-url-path-state
|
||||
*/
|
||||
OPAQUE_PATH,
|
||||
|
||||
/**
|
||||
* @see https://url.spec.whatwg.org/#port-state
|
||||
*/
|
||||
PORT,
|
||||
};
|
||||
|
||||
@ -2753,8 +2832,9 @@ struct expected_operations_base<void, E> : expected_storage_base<void, E> {
|
||||
// This class manages conditionally having a trivial copy constructor
|
||||
// This specialization is for when T and E are trivially copy constructible
|
||||
template <class T, class E,
|
||||
bool = is_void_or<T, TL_EXPECTED_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(T)>::
|
||||
value &&TL_EXPECTED_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(E)::value>
|
||||
bool = is_void_or<T, TL_EXPECTED_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(
|
||||
T)>::value &&
|
||||
TL_EXPECTED_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(E)::value>
|
||||
struct expected_copy_base : expected_operations_base<T, E> {
|
||||
using expected_operations_base<T, E>::expected_operations_base;
|
||||
};
|
||||
@ -2786,8 +2866,9 @@ struct expected_copy_base<T, E, false> : expected_operations_base<T, E> {
|
||||
// move constructible
|
||||
#ifndef TL_EXPECTED_GCC49
|
||||
template <class T, class E,
|
||||
bool = is_void_or<T, std::is_trivially_move_constructible<T>>::value
|
||||
&&std::is_trivially_move_constructible<E>::value>
|
||||
bool =
|
||||
is_void_or<T, std::is_trivially_move_constructible<T>>::value &&
|
||||
std::is_trivially_move_constructible<E>::value>
|
||||
struct expected_move_base : expected_copy_base<T, E> {
|
||||
using expected_copy_base<T, E>::expected_copy_base;
|
||||
};
|
||||
@ -2816,14 +2897,16 @@ struct expected_move_base<T, E, false> : expected_copy_base<T, E> {
|
||||
};
|
||||
|
||||
// This class manages conditionally having a trivial copy assignment operator
|
||||
template <class T, class E,
|
||||
bool = is_void_or<
|
||||
T, conjunction<TL_EXPECTED_IS_TRIVIALLY_COPY_ASSIGNABLE(T),
|
||||
TL_EXPECTED_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(T),
|
||||
TL_EXPECTED_IS_TRIVIALLY_DESTRUCTIBLE(T)>>::value
|
||||
&&TL_EXPECTED_IS_TRIVIALLY_COPY_ASSIGNABLE(E)::value
|
||||
&&TL_EXPECTED_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(E)::value
|
||||
&&TL_EXPECTED_IS_TRIVIALLY_DESTRUCTIBLE(E)::value>
|
||||
template <
|
||||
class T, class E,
|
||||
bool =
|
||||
is_void_or<
|
||||
T, conjunction<TL_EXPECTED_IS_TRIVIALLY_COPY_ASSIGNABLE(T),
|
||||
TL_EXPECTED_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(T),
|
||||
TL_EXPECTED_IS_TRIVIALLY_DESTRUCTIBLE(T)>>::value &&
|
||||
TL_EXPECTED_IS_TRIVIALLY_COPY_ASSIGNABLE(E)::value &&
|
||||
TL_EXPECTED_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(E)::value &&
|
||||
TL_EXPECTED_IS_TRIVIALLY_DESTRUCTIBLE(E)::value>
|
||||
struct expected_copy_assign_base : expected_move_base<T, E> {
|
||||
using expected_move_base<T, E>::expected_move_base;
|
||||
};
|
||||
@ -2850,14 +2933,15 @@ struct expected_copy_assign_base<T, E, false> : expected_move_base<T, E> {
|
||||
// to make do with a non-trivial move assignment operator even if T is trivially
|
||||
// move assignable
|
||||
#ifndef TL_EXPECTED_GCC49
|
||||
template <class T, class E,
|
||||
bool =
|
||||
is_void_or<T, conjunction<std::is_trivially_destructible<T>,
|
||||
std::is_trivially_move_constructible<T>,
|
||||
std::is_trivially_move_assignable<T>>>::
|
||||
value &&std::is_trivially_destructible<E>::value
|
||||
&&std::is_trivially_move_constructible<E>::value
|
||||
&&std::is_trivially_move_assignable<E>::value>
|
||||
template <
|
||||
class T, class E,
|
||||
bool = is_void_or<
|
||||
T, conjunction<std::is_trivially_destructible<T>,
|
||||
std::is_trivially_move_constructible<T>,
|
||||
std::is_trivially_move_assignable<T>>>::value &&
|
||||
std::is_trivially_destructible<E>::value &&
|
||||
std::is_trivially_move_constructible<E>::value &&
|
||||
std::is_trivially_move_assignable<E>::value>
|
||||
struct expected_move_assign_base : expected_copy_assign_base<T, E> {
|
||||
using expected_copy_assign_base<T, E>::expected_copy_assign_base;
|
||||
};
|
||||
@ -2879,10 +2963,10 @@ struct expected_move_assign_base<T, E, false>
|
||||
expected_move_assign_base &operator=(const expected_move_assign_base &rhs) =
|
||||
default;
|
||||
|
||||
expected_move_assign_base &
|
||||
operator=(expected_move_assign_base &&rhs) noexcept(
|
||||
std::is_nothrow_move_constructible<T>::value
|
||||
&&std::is_nothrow_move_assignable<T>::value) {
|
||||
expected_move_assign_base &operator=(
|
||||
expected_move_assign_base
|
||||
&&rhs) noexcept(std::is_nothrow_move_constructible<T>::value &&
|
||||
std::is_nothrow_move_assignable<T>::value) {
|
||||
this->assign(std::move(rhs));
|
||||
return *this;
|
||||
}
|
||||
@ -3771,11 +3855,10 @@ class expected : private detail::expected_move_assign_base<T, E>,
|
||||
detail::is_swappable<OE>::value &&
|
||||
(std::is_nothrow_move_constructible<OT>::value ||
|
||||
std::is_nothrow_move_constructible<OE>::value)>
|
||||
swap(expected &rhs) noexcept(
|
||||
std::is_nothrow_move_constructible<T>::value
|
||||
&&detail::is_nothrow_swappable<T>::value
|
||||
&&std::is_nothrow_move_constructible<E>::value
|
||||
&&detail::is_nothrow_swappable<E>::value) {
|
||||
swap(expected &rhs) noexcept(std::is_nothrow_move_constructible<T>::value &&
|
||||
detail::is_nothrow_swappable<T>::value &&
|
||||
std::is_nothrow_move_constructible<E>::value &&
|
||||
detail::is_nothrow_swappable<E>::value) {
|
||||
if (has_value() && rhs.has_value()) {
|
||||
swap_where_both_have_value(rhs, typename std::is_void<T>::type{});
|
||||
} else if (!has_value() && rhs.has_value()) {
|
||||
@ -4312,7 +4395,10 @@ struct url;
|
||||
namespace ada::parser {
|
||||
|
||||
/**
|
||||
* Parses a url.
|
||||
* Parses a url. The parameter user_input is the input to be parsed:
|
||||
* it should be a valid UTF-8 string. The parameter base_url is an optional
|
||||
* parameter that can be used to resolve relative URLs. If the base_url is
|
||||
* provided, the user_input is resolved against the base_url.
|
||||
*/
|
||||
template <typename result_type = ada::url_aggregator>
|
||||
result_type parse_url(std::string_view user_input,
|
||||
@ -7169,14 +7255,14 @@ url_search_params_entries_iter::next() {
|
||||
#ifndef ADA_ADA_VERSION_H
|
||||
#define ADA_ADA_VERSION_H
|
||||
|
||||
#define ADA_VERSION "2.7.8"
|
||||
#define ADA_VERSION "2.8.0"
|
||||
|
||||
namespace ada {
|
||||
|
||||
enum {
|
||||
ADA_VERSION_MAJOR = 2,
|
||||
ADA_VERSION_MINOR = 7,
|
||||
ADA_VERSION_REVISION = 8,
|
||||
ADA_VERSION_MINOR = 8,
|
||||
ADA_VERSION_REVISION = 0,
|
||||
};
|
||||
|
||||
} // namespace ada
|
||||
|
Loading…
Reference in New Issue
Block a user