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

Method expectToken2

src/e9tool/e9parser.cpp:706–719  ·  view source on GitHub ↗

* Expect one of two tokens, else error. */

Source from the content-addressed store, hash-verified

704 * Expect one of two tokens, else error.
705 */
706int Parser::expectToken2(int token1, int token2)
707{
708 int t = getToken();
709 if (t != token1 && t != token2)
710 {
711 std::string str;
712 getPositionStr(str);
713 error("failed to parse %s at position \"%s\"; expected token "
714 "\"%s\" or \"%s\", found \"%s\"", mode, str.c_str(),
715 getNameFromToken((Token)token1),
716 getNameFromToken((Token)token2), s);
717 }
718 return t;
719}
720
721/*
722 * Unexpected token error.

Callers 2

parseMatchArgFunction · 0.80
parsePatchFunction · 0.80

Calls 3

getTokenFunction · 0.85
errorFunction · 0.85
getNameFromTokenFunction · 0.85

Tested by

no test coverage detected