MCPcopy Create free account
hub / github.com/IBM/Project_CodeNet / expect_nodeid

Function expect_nodeid

tools/json-graph/src/jgflib.c:367–373  ·  view source on GitHub ↗

Checks whether token is string or number literal. */

Source from the content-addressed store, hash-verified

365
366/** Checks whether token is string or number literal. */
367static void expect_nodeid(jsmntok_t *tok)
368{
369 /* Note: being an integer as opposed to float is not checked! */
370 if (!(tok->type == JSMN_STRING && !tok->size ||
371 tok->type == JSMN_PRIMITIVE && isdigit(input[tok->start])))
372 error(tok, "string or integer literal");
373}
374
375/** Checks whether token is a false or true literal. */
376static void expect_bool(jsmntok_t *tok)

Callers 1

jgf_parseFunction · 0.85

Calls 1

errorFunction · 0.85

Tested by

no test coverage detected