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

Method get_safe_token

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

Source from the content-addressed store, hash-verified

9532
9533template <url_pattern_regex::regex_concept regex_provider>
9534constexpr const token*
9535constructor_string_parser<regex_provider>::get_safe_token(size_t index) const {
9536 // If index is less than parser's token list's size, then return parser's
9537 // token list[index].
9538 if (index < token_list.size()) [[likely]] {
9539 return &token_list[index];
9540 }
9541
9542 // Assert: parser's token list's size is greater than or equal to 1.
9543 ADA_ASSERT_TRUE(!token_list.empty());
9544
9545 // Let token be parser's token list[last index].
9546 // Assert: token's type is "end".
9547 ADA_ASSERT_TRUE(token_list.back().type == token_type::END);
9548
9549 // Return token.
9550 return &token_list.back();
9551}
9552
9553template <url_pattern_regex::regex_concept regex_provider>
9554constexpr bool constructor_string_parser<regex_provider>::is_group_open()

Callers

nothing calls this directly

Calls 3

backMethod · 0.80
sizeMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected