* Allocates a fresh unused token from the token pool. */
| 104 | * Allocates a fresh unused token from the token pool. |
| 105 | */ |
| 106 | static jsmntok_t *jsmn_alloc_token(jsmn_parser *parser, jsmntok_t *tokens, |
| 107 | const size_t num_tokens) { |
| 108 | jsmntok_t *tok; |
| 109 | if (parser->toknext >= num_tokens) { |
| 110 | return NULL; |
| 111 | } |
| 112 | tok = &tokens[parser->toknext++]; |
| 113 | tok->type = JSMN_UNDEFINED; |
| 114 | tok->start = tok->end = -1; |
| 115 | tok->size = 0; |
| 116 | #ifdef JSMN_PARENT_LINKS |
| 117 | tok->parent = -1; |
| 118 | #endif |
| 119 | return tok; |
| 120 | } |
| 121 | |
| 122 | /** |
| 123 | * Fills token type and boundaries. |
no outgoing calls
no test coverage detected