GeezerVison is showing github.com — deps: update ada to 3.2.4 · nodejs/node@5e27078
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: deps/ada/ada.cpp +19-19Lines changed: 19 additions & 19 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | | -/* auto-generated on 2025-04-24 20:04:09 -0400. Do not edit! */ | | 1 | +/* auto-generated on 2025-04-28 12:16:36 -0400. Do not edit! */ | 2 | 2 | /* begin file src/ada.cpp */ | 3 | 3 | #include "ada.h" | 4 | 4 | /* begin file src/checkers.cpp */ | @@ -56,8 +56,8 @@ ada_really_inline constexpr bool is_ipv4(std::string_view view) noexcept { | 56 | 56 | } | 57 | 57 | // We have 0x followed by some characters, we need to check that they are | 58 | 58 | // hexadecimals. | 59 | | - return std::all_of(view.begin() + 2, view.end(), | 60 | | - ada::unicode::is_lowercase_hex); | | 59 | + view.remove_prefix(2); | | 60 | + return std::ranges::all_of(view, ada::unicode::is_lowercase_hex); | 61 | 61 | } | 62 | 62 |
| 63 | 63 | // for use with path_signature, we include all characters that need percent | @@ -10421,6 +10421,8 @@ ADA_POP_DISABLE_WARNINGS | 10421 | 10421 | #include <emmintrin.h> | 10422 | 10422 | #endif | 10423 | 10423 |
| | 10424 | +#include <ranges> | | 10425 | + | 10424 | 10426 | namespace ada::unicode { | 10425 | 10427 |
| 10426 | 10428 | constexpr bool is_tabs_or_newline(char c) noexcept { | @@ -10461,8 +10463,7 @@ ada_really_inline bool has_tabs_or_newline( | 10461 | 10463 | std::string_view user_input) noexcept { | 10462 | 10464 | // first check for short strings in which case we do it naively. | 10463 | 10465 | if (user_input.size() < 16) { // slow path | 10464 | | - return std::any_of(user_input.begin(), user_input.end(), | 10465 | | - is_tabs_or_newline); | | 10466 | + return std::ranges::any_of(user_input, is_tabs_or_newline); | 10466 | 10467 | } | 10467 | 10468 | // fast path for long strings (expected to be common) | 10468 | 10469 | size_t i = 0; | @@ -10500,8 +10501,7 @@ ada_really_inline bool has_tabs_or_newline( | 10500 | 10501 | std::string_view user_input) noexcept { | 10501 | 10502 | // first check for short strings in which case we do it naively. | 10502 | 10503 | if (user_input.size() < 16) { // slow path | 10503 | | - return std::any_of(user_input.begin(), user_input.end(), | 10504 | | - is_tabs_or_newline); | | 10504 | + return std::ranges::any_of(user_input, is_tabs_or_newline); | 10505 | 10505 | } | 10506 | 10506 | // fast path for long strings (expected to be common) | 10507 | 10507 | size_t i = 0; | @@ -10832,10 +10832,9 @@ bool percent_encode(const std::string_view input, const uint8_t character_set[], | 10832 | 10832 | std::string& out) { | 10833 | 10833 | ada_log("percent_encode ", input, " to output string while ", | 10834 | 10834 | append ? "appending" : "overwriting"); | 10835 | | - auto pointer = | 10836 | | - std::find_if(input.begin(), input.end(), [character_set](const char c) { | 10837 | | - return character_sets::bit_at(character_set, c); | 10838 | | - }); | | 10835 | + auto pointer = std::ranges::find_if(input, [character_set](const char c) { | | 10836 | + return character_sets::bit_at(character_set, c); | | 10837 | + }); | 10839 | 10838 | ada_log("percent_encode done checking, moved to ", | 10840 | 10839 | std::distance(input.begin(), pointer)); | 10841 | 10840 |
| @@ -11850,15 +11849,15 @@ ada_warn_unused std::string to_string(ada::state state) { | 11850 | 11849 |
| 11851 | 11850 | #include <numeric> | 11852 | 11851 | #include <algorithm> | | 11852 | +#include <ranges> | 11853 | 11853 | #include <string> | 11854 | 11854 | #include <string_view> | 11855 | 11855 |
| 11856 | 11856 | namespace ada { | 11857 | 11857 |
| 11858 | 11858 | bool url::parse_opaque_host(std::string_view input) { | 11859 | 11859 | ada_log("parse_opaque_host ", input, " [", input.size(), " bytes]"); | 11860 | | - if (std::ranges::any_of(input.begin(), input.end(), | 11861 | | - ada::unicode::is_forbidden_host_code_point)) { | | 11860 | + if (std::ranges::any_of(input, ada::unicode::is_forbidden_host_code_point)) { | 11862 | 11861 | return is_valid = false; | 11863 | 11862 | } | 11864 | 11863 |
| @@ -12725,6 +12724,7 @@ bool url::set_href(const std::string_view input) { | 12725 | 12724 | /* begin file src/parser.cpp */ | 12726 | 12725 |
| 12727 | 12726 | #include <limits> | | 12727 | +#include <ranges> | 12728 | 12728 |
| 12729 | 12729 |
| 12730 | 12730 | namespace ada::parser { | @@ -13344,7 +13344,7 @@ result_type parse_url_impl(std::string_view user_input, | 13344 | 13344 | // to optimize it. | 13345 | 13345 | if (view.ends_with(' ')) { | 13346 | 13346 | std::string modified_view = | 13347 | | - std::string(view.begin(), view.end() - 1) + "%20"; | | 13347 | + std::string(view.substr(0, view.size() - 1)) + "%20"; | 13348 | 13348 | url.update_base_pathname(unicode::percent_encode( | 13349 | 13349 | modified_view, character_sets::C0_CONTROL_PERCENT_ENCODE)); | 13350 | 13350 | } else { | @@ -13694,6 +13694,7 @@ namespace ada { | 13694 | 13694 | /* end file src/url_components.cpp */ | 13695 | 13695 | /* begin file src/url_aggregator.cpp */ | 13696 | 13696 |
| | 13697 | +#include <ranges> | 13697 | 13698 | #include <string> | 13698 | 13699 | #include <string_view> | 13699 | 13700 |
| @@ -13913,7 +13914,7 @@ bool url_aggregator::set_protocol(const std::string_view input) { | 13913 | 13914 |
| 13914 | 13915 | if (pointer != view.end() && *pointer == ':') { | 13915 | 13916 | return parse_scheme_with_colon<true>( | 13916 | | - std::string_view(view.data(), pointer - view.begin() + 1)); | | 13917 | + view.substr(0, pointer - view.begin() + 1)); | 13917 | 13918 | } | 13918 | 13919 | return false; | 13919 | 13920 | } | @@ -14175,8 +14176,8 @@ ada_really_inline bool url_aggregator::parse_host(std::string_view input) { | 14175 | 14176 | ada_log("parse_host to_ascii succeeded ", *host, " [", host->size(), | 14176 | 14177 | " bytes]"); | 14177 | 14178 |
| 14178 | | - if (std::any_of(host.value().begin(), host.value().end(), | 14179 | | - ada::unicode::is_forbidden_domain_code_point)) { | | 14179 | + if (std::ranges::any_of(host.value(), | | 14180 | + ada::unicode::is_forbidden_domain_code_point)) { | 14180 | 14181 | return is_valid = false; | 14181 | 14182 | } | 14182 | 14183 |
| @@ -14868,8 +14869,7 @@ bool url_aggregator::parse_opaque_host(std::string_view input) { | 14868 | 14869 | ada_log("parse_opaque_host ", input, " [", input.size(), " bytes]"); | 14869 | 14870 | ADA_ASSERT_TRUE(validate()); | 14870 | 14871 | ADA_ASSERT_TRUE(!helpers::overlaps(input, buffer)); | 14871 | | - if (std::any_of(input.begin(), input.end(), | 14872 | | - ada::unicode::is_forbidden_host_code_point)) { | | 14872 | + if (std::ranges::any_of(input, ada::unicode::is_forbidden_host_code_point)) { | 14873 | 14873 | return is_valid = false; | 14874 | 14874 | } | 14875 | 14875 |
| |
Collapse file Copy file name to clipboardExpand all lines: deps/ada/ada.h +15-21Lines changed: 15 additions & 21 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | | -/* auto-generated on 2025-04-24 20:04:09 -0400. Do not edit! */ | | 1 | +/* auto-generated on 2025-04-28 12:16:36 -0400. Do not edit! */ | 2 | 2 | /* begin file include/ada.h */ | 3 | 3 | /** | 4 | 4 | * @file ada.h | @@ -4115,7 +4115,6 @@ void swap(expected<T, E> &lhs, | 4115 | 4115 | #endif | 4116 | 4116 | /* end file include/ada/expected.h */ | 4117 | 4117 |
| 4118 | | -#if ADA_INCLUDE_URL_PATTERN | 4119 | 4118 | /* begin file include/ada/url_pattern_regex.h */ | 4120 | 4119 | /** | 4121 | 4120 | * @file url_search_params.h | @@ -4131,6 +4130,7 @@ void swap(expected<T, E> &lhs, | 4131 | 4130 | #include <regex> | 4132 | 4131 | #endif // ADA_USE_UNSAFE_STD_REGEX_PROVIDER | 4133 | 4132 |
| | 4133 | +#if ADA_INCLUDE_URL_PATTERN | 4134 | 4134 | namespace ada::url_pattern_regex { | 4135 | 4135 |
| 4136 | 4136 | template <typename T> | @@ -4175,7 +4175,7 @@ class std_regex_provider final { | 4175 | 4175 | #endif // ADA_USE_UNSAFE_STD_REGEX_PROVIDER | 4176 | 4176 |
| 4177 | 4177 | } // namespace ada::url_pattern_regex | 4178 | | - | | 4178 | +#endif // ADA_INCLUDE_URL_PATTERN | 4179 | 4179 | #endif // ADA_URL_PATTERN_REGEX_H | 4180 | 4180 | /* end file include/ada/url_pattern_regex.h */ | 4181 | 4181 | /* begin file include/ada/url_pattern_init.h */ | @@ -4209,6 +4209,7 @@ enum class errors : uint8_t { type_error }; | 4209 | 4209 | #include <iostream> | 4210 | 4210 | #endif // ADA_TESTING | 4211 | 4211 |
| | 4212 | +#if ADA_INCLUDE_URL_PATTERN | 4212 | 4213 | namespace ada { | 4213 | 4214 |
| 4214 | 4215 | // Important: C++20 allows us to use concept rather than `using` or `typedef | @@ -4312,10 +4313,9 @@ struct url_pattern_init { | 4312 | 4313 | std::optional<std::string> base_url{}; | 4313 | 4314 | }; | 4314 | 4315 | } // namespace ada | 4315 | | - | | 4316 | +#endif // ADA_INCLUDE_URL_PATTERN | 4316 | 4317 | #endif // ADA_URL_PATTERN_INIT_H | 4317 | 4318 | /* end file include/ada/url_pattern_init.h */ | 4318 | | -#endif // ADA_INCLUDE_URL_PATTERN | 4319 | 4319 |
| 4320 | 4320 | /** | 4321 | 4321 | * @private | @@ -4378,7 +4378,6 @@ tl::expected<url_pattern<regex_provider>, errors> parse_url_pattern_impl( | 4378 | 4378 | #ifndef ADA_PARSER_INL_H | 4379 | 4379 | #define ADA_PARSER_INL_H | 4380 | 4380 |
| 4381 | | -#if ADA_INCLUDE_URL_PATTERN | 4382 | 4381 | /* begin file include/ada/url_pattern.h */ | 4383 | 4382 | /** | 4384 | 4383 | * @file url_pattern.h | @@ -5014,9 +5013,6 @@ inline std::ostream &operator<<(std::ostream &out, const ada::url &u); | 5014 | 5013 | #endif // ADA_URL_H | 5015 | 5014 | /* end file include/ada/url.h */ | 5016 | 5015 |
| 5017 | | -#if ADA_INCLUDE_URL_PATTERN | 5018 | | -#endif // ADA_INCLUDE_URL_PATTERN | 5019 | | - | 5020 | 5016 | namespace ada { | 5021 | 5017 |
| 5022 | 5018 | template <class result_type = ada::url_aggregator> | @@ -5088,6 +5084,7 @@ std::string href_from_file(std::string_view path); | 5088 | 5084 | #include <iostream> | 5089 | 5085 | #endif // ADA_TESTING | 5090 | 5086 |
| | 5087 | +#if ADA_INCLUDE_URL_PATTERN | 5091 | 5088 | namespace ada { | 5092 | 5089 |
| 5093 | 5090 | enum class url_pattern_part_type : uint8_t { | @@ -5420,9 +5417,8 @@ class url_pattern { | 5420 | 5417 | */ | 5421 | 5418 | bool ignore_case_ = false; | 5422 | 5419 | }; | 5423 | | - | 5424 | 5420 | } // namespace ada | 5425 | | - | | 5421 | +#endif // ADA_INCLUDE_URL_PATTERN | 5426 | 5422 | #endif | 5427 | 5423 | /* end file include/ada/url_pattern.h */ | 5428 | 5424 | /* begin file include/ada/url_pattern_helpers.h */ | @@ -5438,6 +5434,7 @@ class url_pattern { | 5438 | 5434 | #include <tuple> | 5439 | 5435 | #include <vector> | 5440 | 5436 |
| | 5437 | +#if ADA_INCLUDE_URL_PATTERN | 5441 | 5438 | namespace ada { | 5442 | 5439 | enum class errors : uint8_t; | 5443 | 5440 | } | @@ -5769,10 +5766,9 @@ std::string generate_segment_wildcard_regexp( | 5769 | 5766 | url_pattern_compile_component_options options); | 5770 | 5767 |
| 5771 | 5768 | } // namespace ada::url_pattern_helpers | 5772 | | - | | 5769 | +#endif // ADA_INCLUDE_URL_PATTERN | 5773 | 5770 | #endif | 5774 | 5771 | /* end file include/ada/url_pattern_helpers.h */ | 5775 | | -#endif // ADA_INCLUDE_URL_PATTERN | 5776 | 5772 |
| 5777 | 5773 | #include <string> | 5778 | 5774 | #include <string_view> | @@ -8915,7 +8911,6 @@ url_search_params_entries_iter::next() { | 8915 | 8911 | #endif // ADA_URL_SEARCH_PARAMS_INL_H | 8916 | 8912 | /* end file include/ada/url_search_params-inl.h */ | 8917 | 8913 |
| 8918 | | -#if ADA_INCLUDE_URL_PATTERN | 8919 | 8914 | /* begin file include/ada/url_pattern-inl.h */ | 8920 | 8915 | /** | 8921 | 8916 | * @file url_pattern-inl.h | @@ -8929,6 +8924,7 @@ url_search_params_entries_iter::next() { | 8929 | 8924 | #include <string_view> | 8930 | 8925 | #include <utility> | 8931 | 8926 |
| | 8927 | +#if ADA_INCLUDE_URL_PATTERN | 8932 | 8928 | namespace ada { | 8933 | 8929 |
| 8934 | 8930 | inline bool url_pattern_init::operator==(const url_pattern_init& other) const { | @@ -9397,7 +9393,7 @@ result<std::optional<url_pattern_result>> url_pattern<regex_provider>::match( | 9397 | 9393 | } | 9398 | 9394 |
| 9399 | 9395 | } // namespace ada | 9400 | | - | | 9396 | +#endif // ADA_INCLUDE_URL_PATTERN | 9401 | 9397 | #endif | 9402 | 9398 | /* end file include/ada/url_pattern-inl.h */ | 9403 | 9399 | /* begin file include/ada/url_pattern_helpers-inl.h */ | @@ -9412,6 +9408,7 @@ result<std::optional<url_pattern_result>> url_pattern<regex_provider>::match( | 9412 | 9408 | #include <string_view> | 9413 | 9409 |
| 9414 | 9410 |
| | 9411 | +#if ADA_INCLUDE_URL_PATTERN | 9415 | 9412 | namespace ada::url_pattern_helpers { | 9416 | 9413 | #ifdef ADA_TESTING | 9417 | 9414 | inline std::string to_string(token_type type) { | @@ -10488,10 +10485,9 @@ constructor_string_parser<regex_provider>::parse(std::string_view input) { | 10488 | 10485 | } | 10489 | 10486 |
| 10490 | 10487 | } // namespace ada::url_pattern_helpers | 10491 | | - | | 10488 | +#endif // ADA_INCLUDE_URL_PATTERN | 10492 | 10489 | #endif | 10493 | 10490 | /* end file include/ada/url_pattern_helpers-inl.h */ | 10494 | | -#endif // ADA_INCLUDE_URL_PATTERN | 10495 | 10491 |
| 10496 | 10492 | // Public API | 10497 | 10493 | /* begin file include/ada/ada_version.h */ | @@ -10502,14 +10498,14 @@ constructor_string_parser<regex_provider>::parse(std::string_view input) { | 10502 | 10498 | #ifndef ADA_ADA_VERSION_H | 10503 | 10499 | #define ADA_ADA_VERSION_H | 10504 | 10500 |
| 10505 | | -#define ADA_VERSION "3.2.3" | | 10501 | +#define ADA_VERSION "3.2.4" | 10506 | 10502 |
| 10507 | 10503 | namespace ada { | 10508 | 10504 |
| 10509 | 10505 | enum { | 10510 | 10506 | ADA_VERSION_MAJOR = 3, | 10511 | 10507 | ADA_VERSION_MINOR = 2, | 10512 | | - ADA_VERSION_REVISION = 3, | | 10508 | + ADA_VERSION_REVISION = 4, | 10513 | 10509 | }; | 10514 | 10510 |
| 10515 | 10511 | } // namespace ada | @@ -10523,8 +10519,6 @@ enum { | 10523 | 10519 | #ifndef ADA_IMPLEMENTATION_INL_H | 10524 | 10520 | #define ADA_IMPLEMENTATION_INL_H | 10525 | 10521 |
| 10526 | | -#if ADA_INCLUDE_URL_PATTERN | 10527 | | -#endif // ADA_INCLUDE_URL_PATTERN | 10528 | 10522 |
| 10529 | 10523 |
| 10530 | 10524 | #include <variant> | |
|