MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / json_next_number_token

Function json_next_number_token

deps/lua/src/lua_cjson.c:996–1008  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

994}
995
996static void json_next_number_token(json_parse_t *json, json_token_t *token)
997{
998 char *endptr;
999
1000 token->type = T_NUMBER;
1001 token->value.number = fpconv_strtod(json->ptr, &endptr);
1002 if (json->ptr == endptr)
1003 json_set_token_error(token, json, "invalid number");
1004 else
1005 json->ptr = endptr; /* Skip the processed number */
1006
1007 return;
1008}
1009
1010/* Fills in the token struct.
1011 * T_STRING will return a pointer to the json_parse_t temporary string

Callers 1

json_next_tokenFunction · 0.85

Calls 2

fpconv_strtodFunction · 0.85
json_set_token_errorFunction · 0.85

Tested by

no test coverage detected