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

Method add_token

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

Source from the content-addressed store, hash-verified

9815}
9816
9817inline void Tokenizer::add_token(token_type type, size_t next_position,
9818 size_t value_position, size_t value_length) {
9819 ada_log("Tokenizer::add_token called with type=", to_string(type),
9820 " next_position=", next_position, " value_position=", value_position);
9821 ADA_ASSERT_TRUE(next_position >= value_position);
9822
9823 // Let token be a new token.
9824 // Set token's type to type.
9825 // Set token's index to tokenizer's index.
9826 // Set token's value to the code point substring from value position with
9827 // length value length within tokenizer's input.
9828 // Append token to the back of tokenizer's token list.
9829 token_list.emplace_back(type, index,
9830 input.substr(value_position, value_length));
9831 // Set tokenizer's index to next position.
9832 index = next_position;
9833}
9834
9835inline void Tokenizer::add_token_with_default_length(token_type type,
9836 size_t next_position,

Callers 1

tokenizeFunction · 0.80

Calls 2

to_stringFunction · 0.85
emplace_backMethod · 0.80

Tested by

no test coverage detected