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

Method try_consume_token

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

Source from the content-addressed store, hash-verified

9898
9899template <url_pattern_encoding_callback F>
9900token* url_pattern_parser<F>::try_consume_token(token_type type) {
9901 ada_log("url_pattern_parser::try_consume_token called with type=",
9902 to_string(type));
9903 // Assert: parser's index is less than parser's token list size.
9904 ADA_ASSERT_TRUE(index < tokens.size());
9905 // Let next token be parser's token list[parser's index].
9906 auto& next_token = tokens[index];
9907 // If next token's type is not type return null.
9908 if (next_token.type != type) return nullptr;
9909 // Increase parser's index by 1.
9910 index++;
9911 // Return next token.
9912 return &next_token;
9913}
9914
9915template <url_pattern_encoding_callback F>
9916std::string url_pattern_parser<F>::consume_text() {

Callers 1

parse_pattern_stringFunction · 0.80

Calls 2

to_stringFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected