============ idCompiler::CheckType Parses a variable type, including functions types ============ */
| 854 | ============ |
| 855 | */ |
| 856 | idTypeDef *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 | ============ |