| 9815 | } |
| 9816 | |
| 9817 | inline 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 | |
| 9835 | inline void Tokenizer::add_token_with_default_length(token_type type, |
| 9836 | size_t next_position, |
no test coverage detected