Lines Matching defs:tok
141 gettok(const char *s, int *from, int *to, int *tok)
155 return *tok = -1;
158 *tok = (matches[2].rm_so >= 0) ? MJ_NUMBER :
171 return *tok;
343 mj_parse(mj_t *atom, const char *s, int *from, int *to, int *tok)
347 switch(atom->type = *tok = gettok(s, from, to, tok)) {
351 return gettok(s, from, to, tok);
355 return gettok(s, from, to, tok);
360 return gettok(s, from, to, tok);
364 while (mj_parse(&atom->value.v[atom->c++], s, from, to, tok) >= 0 && *tok != MJ_CLOSE_BRACKET) {
365 if (*tok != MJ_COMMA) {
366 (void) fprintf(stderr, "1. expected comma (got %d) at '%s'\n", *tok, &s[*from]);
371 return gettok(s, from, to, tok);
375 for (i = 0 ; mj_parse(&atom->value.v[atom->c++], s, from, to, tok) >= 0 && *tok != MJ_CLOSE_BRACE ; i++) {
376 if (((i % 2) == 0 && *tok != MJ_COLON) || ((i % 2) == 1 && *tok != MJ_COMMA)) {
377 (void) fprintf(stderr, "2. expected comma (got %d) at '%s'\n", *tok, &s[*from]);
382 return gettok(s, from, to, tok);
384 return *tok;