Lines Matching full:token

6  * Allocates a fresh unused token from the token pull.
24 * Fills token type and boundaries.
26 static void jsmn_fill_token(jsmntok_t *token, jsmntype_t type, in jsmn_fill_token() argument
28 token->type = type; in jsmn_fill_token()
29 token->start = start; in jsmn_fill_token()
30 token->end = end; in jsmn_fill_token()
31 token->size = 0; in jsmn_fill_token()
35 * Fills next available token with JSON primitive.
39 jsmntok_t *token; in jsmn_parse_primitive() local
70 token = jsmn_alloc_token(parser, tokens, num_tokens); in jsmn_parse_primitive()
71 if (token == NULL) { in jsmn_parse_primitive()
75 jsmn_fill_token(token, JSMN_PRIMITIVE, start, parser->pos); in jsmn_parse_primitive()
77 token->parent = parser->toksuper; in jsmn_parse_primitive()
84 * Filsl next token with JSON string.
88 jsmntok_t *token; in jsmn_parse_string() local
103 token = jsmn_alloc_token(parser, tokens, num_tokens); in jsmn_parse_string()
104 if (token == NULL) { in jsmn_parse_string()
108 jsmn_fill_token(token, JSMN_STRING, start+1, parser->pos); in jsmn_parse_string()
110 token->parent = parser->toksuper; in jsmn_parse_string()
157 jsmntok_t *token; in jsmn_parse() local
171 token = jsmn_alloc_token(parser, tokens, num_tokens); in jsmn_parse()
172 if (token == NULL) in jsmn_parse()
177 token->parent = parser->toksuper; in jsmn_parse()
180 token->type = (c == '{' ? JSMN_OBJECT : JSMN_ARRAY); in jsmn_parse()
181 token->start = parser->pos; in jsmn_parse()
192 token = &tokens[parser->toknext - 1]; in jsmn_parse()
194 if (token->start != -1 && token->end == -1) { in jsmn_parse()
195 if (token->type != type) { in jsmn_parse()
198 token->end = parser->pos + 1; in jsmn_parse()
199 parser->toksuper = token->parent; in jsmn_parse()
202 if (token->parent == -1) { in jsmn_parse()
205 token = &tokens[token->parent]; in jsmn_parse()
209 token = &tokens[i]; in jsmn_parse()
210 if (token->start != -1 && token->end == -1) { in jsmn_parse()
211 if (token->type != type) { in jsmn_parse()
215 token->end = parser->pos + 1; in jsmn_parse()
222 token = &tokens[i]; in jsmn_parse()
223 if (token->start != -1 && token->end == -1) { in jsmn_parse()