Lines Matching refs:token
32 * Allocates a fresh unused token from the token pool.
48 * Fills token type and boundaries.
50 static void jsmn_fill_token(jsmntok_t *token, jsmntype_t type,
53 token->type = type;
54 token->start = start;
55 token->end = end;
56 token->size = 0;
60 * Fills next available token with JSON primitive.
66 jsmntok_t *token;
106 token = jsmn_alloc_token(parser, tokens, num_tokens);
107 if (token == NULL) {
111 jsmn_fill_token(token, JSMN_PRIMITIVE, start, parser->pos);
117 * Fills next token with JSON string.
123 jsmntok_t *token;
134 token = jsmn_alloc_token(parser, tokens, num_tokens);
135 if (token == NULL) {
139 jsmn_fill_token(token, JSMN_STRING, start+1,
181 jsmntok_t *token;
191 token = jsmn_alloc_token(parser, tokens, num_tokens);
192 if (token == NULL)
196 token->type = (c == '{' ? JSMN_OBJECT : JSMN_ARRAY);
197 token->start = parser->pos;
204 token = &tokens[i];
205 if (token->start != -1 && token->end == -1) {
206 if (token->type != type)
209 token->end = parser->pos + 1;
217 token = &tokens[i];
218 if (token->start != -1 && token->end == -1) {