MCPcopy Create free account
hub / github.com/dhewm/dhewm3 / ParseFunction

Method ParseFunction

neo/game/script/Script_Compiler.cpp:2107–2128  ·  view source on GitHub ↗

============ idCompiler::ParseFunction parse a function type ============ */

Source from the content-addressed store, hash-verified

2105============
2106*/
2107idTypeDef *idCompiler::ParseFunction( idTypeDef *returnType, const char *name ) {
2108 idTypeDef newtype( ev_function, NULL, name, type_function.Size(), returnType );
2109 idTypeDef *type;
2110
2111 if ( scope->Type() != ev_namespace ) {
2112 // create self pointer
2113 newtype.AddFunctionParm( scope->TypeDef(), "self" );
2114 }
2115
2116 if ( !CheckToken( ")" ) ) {
2117 idStr parmName;
2118 do {
2119 type = ParseType();
2120 ParseName( parmName );
2121 newtype.AddFunctionParm( type, parmName );
2122 } while( CheckToken( "," ) );
2123
2124 ExpectToken( ")" );
2125 }
2126
2127 return gameLocal.program.GetType( newtype, true );
2128}
2129
2130/*
2131================

Callers

nothing calls this directly

Calls 5

SizeMethod · 0.45
TypeMethod · 0.45
AddFunctionParmMethod · 0.45
TypeDefMethod · 0.45
GetTypeMethod · 0.45

Tested by

no test coverage detected