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

Method getTokenFromName

src/e9tool/e9parser.cpp:444–456  ·  view source on GitHub ↗

* Get token from name. */

Source from the content-addressed store, hash-verified

442 * Get token from name.
443 */
444Token Parser::getTokenFromName(const char *name)
445{
446 bool reg = (name[0] == '%' && name[1] != '\0');
447 if (reg)
448 name++;
449 const TokenInfo *info = getTokenInfo(name);
450 if (info == nullptr)
451 return TOKEN_ERROR;
452 if (reg && info->token != TOKEN_REGISTER)
453 return TOKEN_ERROR;
454 i = info->value;
455 return info->token;
456}
457
458/*
459 * Get the next token.

Callers 1

parseFunctionNameFunction · 0.80

Calls 1

getTokenInfoFunction · 0.85

Tested by

no test coverage detected