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

Method CheckType

neo/game/script/Script_Compiler.cpp:856–885  ·  view source on GitHub ↗

============ idCompiler::CheckType Parses a variable type, including functions types ============ */

Source from the content-addressed store, hash-verified

854============
855*/
856idTypeDef *idCompiler::CheckType( void ) {
857 idTypeDef *type;
858
859 if ( token == "float" ) {
860 type = &type_float;
861 } else if ( token == "vector" ) {
862 type = &type_vector;
863 } else if ( token == "entity" ) {
864 type = &type_entity;
865 } else if ( token == "string" ) {
866 type = &type_string;
867 } else if ( token == "void" ) {
868 type = &type_void;
869 } else if ( token == "object" ) {
870 type = &type_object;
871 } else if ( token == "boolean" ) {
872 type = &type_boolean;
873 } else if ( token == "namespace" ) {
874 type = &type_namespace;
875 } else if ( token == "scriptEvent" ) {
876 type = &type_scriptevent;
877 } else {
878 type = gameLocal.program.FindType( token.c_str() );
879 if ( type && !type->Inherits( &type_object ) ) {
880 type = NULL;
881 }
882 }
883
884 return type;
885}
886
887/*
888============

Callers

nothing calls this directly

Calls 3

FindTypeMethod · 0.45
c_strMethod · 0.45
InheritsMethod · 0.45

Tested by

no test coverage detected