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

Function parseFunctionName

src/e9tool/e9action.cpp:869–887  ·  view source on GitHub ↗

* Parse a function name. */

Source from the content-addressed store, hash-verified

867 * Parse a function name.
868 */
869static const char *parseFunctionName(Parser &parser)
870{
871 if (!isalpha(parser.s[0]) && parser.s[0] != '_')
872 parser.unexpectedToken();
873 for (unsigned i = 1; parser.s[i] != '\0'; i++)
874 {
875 if (!isalpha(parser.s[i]) && !isdigit(parser.s[i]) &&
876 parser.s[i] != '_')
877 parser.unexpectedToken();
878 }
879 switch (parser.getTokenFromName(parser.s))
880 {
881 case TOKEN_IF: case TOKEN_GOTO:
882 parser.unexpectedToken();
883 default:
884 break;
885 }
886 return strDup(parser.s);
887}
888
889/*
890 * Parse a name.

Callers 1

parsePatchFunction · 0.85

Calls 5

isalphaFunction · 0.85
strDupFunction · 0.85
unexpectedTokenMethod · 0.80
getTokenFromNameMethod · 0.80
isdigitFunction · 0.50

Tested by

no test coverage detected