library/src/javascript/JSON/BP-LibJSMN.cc
/**
 * Allocates a fresh unused token from the token pull.
 */
Allocates a fresh unused token from the token pull.
Allocates a fresh unused token from the token pull .
static jsmntok_t *jsmn_alloc_token
(
	P_BP_JSON    json,
	jsmn_parser *parser,
	jsmntok_t   *tokens,
	size_t       num_tokens
)
{
	jsmntok_t *tok;
	if (parser->toknext >= num_tokens)
	{
		BP_JSONParseAddErrorMsg(json, NULL, "parser->toknext >= num_tokens.  JSON parsing attempt exhausted preallocated token space.  Likely cause is JSON being too large.");
		return NULL;
	}
	tok = &tokens[parser->toknext++];
	tok->end    = -1;
	tok->start  = tok->end;
	tok->size   = 0;
	tok->parent = -1;
	return tok;
}
static jsmntok_t * jsmn_alloc_token ( P_BP_JSON json , jsmn_parser * parser , jsmntok_t * tokens , size_t num_tokens ) { jsmntok_t * tok ; if ( parser -> toknext >= num_tokens ) { BP_JSONParseAddErrorMsg ( json , NULL , " " ) ; return NULL ; } tok = & tokens [ parser -> toknext ++ ] ; tok -> end = -1 ; tok -> start = tok -> end ; tok -> size = 0 ; tok -> parent = -1 ; return tok ; }
Allocates a fresh unused token from the token pull.
Allocates a fresh unused token from the token pull .
// note, this was modified by JM due to compilation errors from this = that = -1;