Commits

Anonymous committed fd28772

renamed: get_token to alloc_token

  • Participants
  • Parent commits 49d53f6

Comments (0)

Files changed (1)

 /**
  * Allocates a fresh unused token from the token pull.
  */
-static jsmntok_t *jsmn_get_token(jsmn_parser *parser) {
+static jsmntok_t *jsmn_alloc_token(jsmn_parser *parser) {
 	unsigned int i;
 	jsmntok_t *tokens = parser->tokens;
 	for (i = parser->curtoken; i<parser->num_tokens; i++) {
 		switch (js[parser->pos]) {
 			case '\t' : case '\r' : case '\n' : case ' ' :
 			case ','  : case ']'  : case '}' :
-				token = jsmn_get_token(parser);
+				token = jsmn_alloc_token(parser);
 				if (token == NULL)
 					return JSMN_ERROR_NOMEM;
 				jsmn_fill_token(token, JSMN_PRIMITIVE, start, parser->pos);
 
 		/* Quote: end of string */
 		if (c == '\"') {
-			token = jsmn_get_token(parser);
+			token = jsmn_alloc_token(parser);
 			if (token == NULL)
 				return JSMN_ERROR_NOMEM;
 			jsmn_fill_token(token, JSMN_STRING, start+1, parser->pos);
 		c = js[parser->pos];
 		switch (c) {
 			case '{': case '[':
-				token = jsmn_get_token(parser);
+				token = jsmn_alloc_token(parser);
 				if (token == NULL)
 					return JSMN_ERROR_NOMEM;
 				if (parser->cursize != NULL)