Home | History | Annotate | Download | only in jsmn

Lines Matching refs: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,
28 token->type = type;
29 token->start = start;
30 token->end = end;
31 token->size = 0;
35 * Fills next available token with JSON primitive.
39 jsmntok_t *token;
70 token = jsmn_alloc_token(parser, tokens, num_tokens);
71 if (token == NULL) {
75 jsmn_fill_token(token, JSMN_PRIMITIVE, start, parser->pos);
77 token->parent = parser->toksuper;
84 * Filsl next token with JSON string.
88 jsmntok_t *token;
103 token = jsmn_alloc_token(parser, tokens, num_tokens);
104 if (token == NULL) {
108 jsmn_fill_token(token, JSMN_STRING, start+1, parser->pos);
110 token->parent = parser->toksuper;
157 jsmntok_t *token;
171 token = jsmn_alloc_token(parser, tokens, num_tokens);
172 if (token == NULL)
177 token->parent = parser->toksuper;
180 token->type = (c == '{' ? JSMN_OBJECT : JSMN_ARRAY);
181 token->start = parser->pos;
192 token = &tokens[parser->toknext - 1];
194 if (token->start != -1 && token->end == -1) {
195 if (token->type != type) {
198 token->end = parser->pos + 1;
199 parser->toksuper = token->parent;
202 if (token->parent == -1) {
205 token = &tokens[token->parent];
209 token = &tokens[i];
210 if (token->start != -1 && token->end == -1) {
211 if (token->type != type) {
215 token->end = parser->pos + 1;
222 token = &tokens[i];
223 if (token->start != -1 && token->end == -1) {