Lines Matching refs:token
29 * Allocates a fresh unused token from the token pool.
45 * Fills token type and boundaries.
47 static void jsmn_fill_token(jsmntok_t *token, jsmntype_t type,
50 token->type = type;
51 token->start = start;
52 token->end = end;
53 token->size = 0;
57 * Fills next available token with JSON primitive.
63 jsmntok_t *token;
103 token = jsmn_alloc_token(parser, tokens, num_tokens);
104 if (token == NULL) {
108 jsmn_fill_token(token, JSMN_PRIMITIVE, start, parser->pos);
114 * Fills next token with JSON string.
120 jsmntok_t *token;
131 token = jsmn_alloc_token(parser, tokens, num_tokens);
132 if (token == NULL) {
136 jsmn_fill_token(token, JSMN_STRING, start+1,
178 jsmntok_t *token;
188 token = jsmn_alloc_token(parser, tokens, num_tokens);
189 if (token == NULL)
193 token->type = (c == '{' ? JSMN_OBJECT : JSMN_ARRAY);
194 token->start = parser->pos;
201 token = &tokens[i];
202 if (token->start != -1 && token->end == -1) {
203 if (token->type != type)
206 token->end = parser->pos + 1;
214 token = &tokens[i];
215 if (token->start != -1 && token->end == -1) {