Lines Matching full: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, in jsmn_fill_token() argument
50 token->type = type; in jsmn_fill_token()
51 token->start = start; in jsmn_fill_token()
52 token->end = end; in jsmn_fill_token()
53 token->size = 0; in jsmn_fill_token()
57 * Fills next available token with JSON primitive.
63 jsmntok_t *token; in jsmn_parse_primitive() local
103 token = jsmn_alloc_token(parser, tokens, num_tokens); in jsmn_parse_primitive()
104 if (token == NULL) { in jsmn_parse_primitive()
108 jsmn_fill_token(token, JSMN_PRIMITIVE, start, parser->pos); in jsmn_parse_primitive()
114 * Fills next token with JSON string.
120 jsmntok_t *token; in jsmn_parse_string() local
131 token = jsmn_alloc_token(parser, tokens, num_tokens); in jsmn_parse_string()
132 if (token == NULL) { in jsmn_parse_string()
136 jsmn_fill_token(token, JSMN_STRING, start+1, in jsmn_parse_string()
178 jsmntok_t *token; in jsmn_parse() local
188 token = jsmn_alloc_token(parser, tokens, num_tokens); in jsmn_parse()
189 if (token == NULL) in jsmn_parse()
193 token->type = (c == '{' ? JSMN_OBJECT : JSMN_ARRAY); in jsmn_parse()
194 token->start = parser->pos; in jsmn_parse()
201 token = &tokens[i]; in jsmn_parse()
202 if (token->start != -1 && token->end == -1) { in jsmn_parse()
203 if (token->type != type) in jsmn_parse()
206 token->end = parser->pos + 1; in jsmn_parse()
214 token = &tokens[i]; in jsmn_parse()
215 if (token->start != -1 && token->end == -1) { in jsmn_parse()