MCPcopy Create free account
hub / github.com/NativeScript/android / is_search_prefix

Method is_search_prefix

test-app/runtime/src/main/cpp/ada/ada.h:9475–9505  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9473
9474template <url_pattern_regex::regex_concept regex_provider>
9475constexpr bool constructor_string_parser<regex_provider>::is_search_prefix() {
9476 // If result of running is a non-special pattern char given parser, parser's
9477 // token index and "?" is true, then return true.
9478 if (is_non_special_pattern_char(token_index, '?')) {
9479 return true;
9480 }
9481
9482 // If parser's token list[parser's token index]'s value is not "?", then
9483 // return false.
9484 if (token_list[token_index].value != "?") {
9485 return false;
9486 }
9487
9488 // If previous index is less than 0, then return true.
9489 if (token_index == 0) return true;
9490 // Let previous index be parser's token index - 1.
9491 auto previous_index = token_index - 1;
9492 // Let previous token be the result of running get a safe token given parser
9493 // and previous index.
9494 auto previous_token = get_safe_token(previous_index);
9495 ADA_ASSERT_TRUE(previous_token);
9496 // If any of the following are true, then return false:
9497 // - previous token's type is "name".
9498 // - previous token's type is "regexp".
9499 // - previous token's type is "close".
9500 // - previous token's type is "asterisk".
9501 return !(previous_token->type == token_type::NAME ||
9502 previous_token->type == token_type::REGEXP ||
9503 previous_token->type == token_type::CLOSE ||
9504 previous_token->type == token_type::ASTERISK);
9505}
9506
9507template <url_pattern_regex::regex_concept regex_provider>
9508constexpr bool

Callers 1

parseMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected