Lines Matching refs:token
8 * Allocates a fresh unused token from the token pull.
26 * Fills token type and boundaries.
28 static void jsmn_fill_token(jsmntok_t *token, jsmntype_t type,
30 token->type = type;
31 token->start = start;
32 token->end = end;
33 token->size = 0;
37 * Fills next available token with JSON primitive.
41 jsmntok_t *token;
72 token = jsmn_alloc_token(parser, tokens, num_tokens);
73 if (token == NULL) {
77 jsmn_fill_token(token, JSMN_PRIMITIVE, start, parser->pos);
79 token->parent = parser->toksuper;
86 * Filsl next token with JSON string.
90 jsmntok_t *token;
105 token = jsmn_alloc_token(parser, tokens, num_tokens);
106 if (token == NULL) {
110 jsmn_fill_token(token, JSMN_STRING, start+1, parser->pos);
112 token->parent = parser->toksuper;
159 jsmntok_t *token;
173 token = jsmn_alloc_token(parser, tokens, num_tokens);
174 if (token == NULL)
179 token->parent = parser->toksuper;
182 token->type = (c == '{' ? JSMN_OBJECT : JSMN_ARRAY);
183 token->start = parser->pos;
194 token = &tokens[parser->toknext - 1];
196 if (token->start != -1 && token->end == -1) {
197 if (token->type != type) {
200 token->end = parser->pos + 1;
201 parser->toksuper = token->parent;
204 if (token->parent == -1) {
207 token = &tokens[token->parent];
211 token = &tokens[i];
212 if (token->start != -1 && token->end == -1) {
213 if (token->type != type) {
217 token->end = parser->pos + 1;
224 token = &tokens[i];
225 if (token->start != -1 && token->end == -1) {