Lines Matching refs:token
31 * Allocates a fresh unused token from the token pool.
47 * Fills token type and boundaries.
49 static void jsmn_fill_token(jsmntok_t *token, jsmntype_t type,
52 token->type = type;
53 token->start = start;
54 token->end = end;
55 token->size = 0;
59 * Fills next available token with JSON primitive.
65 jsmntok_t *token;
105 token = jsmn_alloc_token(parser, tokens, num_tokens);
106 if (token == NULL) {
110 jsmn_fill_token(token, JSMN_PRIMITIVE, start, parser->pos);
116 * Fills next token with JSON string.
122 jsmntok_t *token;
133 token = jsmn_alloc_token(parser, tokens, num_tokens);
134 if (token == NULL) {
138 jsmn_fill_token(token, JSMN_STRING, start+1,
180 jsmntok_t *token;
202 token = jsmn_alloc_token(parser, tokens, num_tokens);
203 if (token == NULL)
207 token->type = (c == '{' ? JSMN_OBJECT : JSMN_ARRAY);
208 token->start = parser->pos;
219 token = &tokens[i];
220 if (token->start != -1 && token->end == -1) {
221 if (token->type != type)
224 token->end = parser->pos + 1;
232 token = &tokens[i];
233 if (token->start != -1 && token->end == -1) {