MCPcopy Create free account
hub / github.com/GJDuck/e9patch / expectToken2

Function expectToken2

src/e9patch/e9json.cpp:407–417  ·  view source on GitHub ↗

* Expect `token1' or `token2'. */

Source from the content-addressed store, hash-verified

405 * Expect `token1' or `token2'.
406 */
407static char expectToken2(Parser &parser, char token1, char token2)
408{
409 char got = getToken(parser);
410 if (got == token1 || got == token2)
411 return got;
412 if (parser.isPipe() && got == EOF)
413 exit(EXIT_FAILURE);
414 parse_error(parser, "failed to parse JSON message; expected token "
415 "`%s' or `%s', got token `%s'", getTokenName(token1),
416 getTokenName(token2), getTokenName(got));
417}
418
419/*
420 * Convert a string into a number.

Callers 8

parseAndDiscardObjectFunction · 0.85
makeDataEntryFunction · 0.85
parseTrampolineFunction · 0.85
parseBytesFunction · 0.85
parseMetadataFunction · 0.85
parseStringsFunction · 0.85
parseParamsFunction · 0.85
getMessageFunction · 0.85

Calls 4

getTokenFunction · 0.85
exitFunction · 0.85
getTokenNameFunction · 0.85
isPipeMethod · 0.80

Tested by

no test coverage detected