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

Method expectToken

src/e9tool/e9parser.cpp:691–701  ·  view source on GitHub ↗

* Expect a specific token, else error. */

Source from the content-addressed store, hash-verified

689 * Expect a specific token, else error.
690 */
691void Parser::expectToken(int token)
692{
693 if (getToken() != token)
694 {
695 std::string str;
696 getPositionStr(str);
697 error("failed to parse %s at position \"%s\"; expected token "
698 "\"%s\", found \"%s\"", mode, str.c_str(),
699 getNameFromToken((Token)token), s);
700 }
701}
702
703/*
704 * Expect one of two tokens, else error.

Callers 10

parseIndexFunction · 0.80
parseMemOpFunction · 0.80
parseMatchArgFunction · 0.80
parseMatchExprFunction · 0.80
parseMatchFunction · 0.80
parseSymbolNameFunction · 0.80
parsePatchArgFunction · 0.80
parsePatchFunction · 0.80
parseExcludeBoundFunction · 0.80
parseExcludeFunction · 0.80

Calls 3

getTokenFunction · 0.85
errorFunction · 0.85
getNameFromTokenFunction · 0.85

Tested by

no test coverage detected