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

Method GetTerm

neo/d3xp/script/Script_Compiler.cpp:1327–1460  ·  view source on GitHub ↗

============ idCompiler::GetTerm ============ */

Source from the content-addressed store, hash-verified

1325============
1326*/
1327idVarDef *idCompiler::GetTerm( void ) {
1328 idVarDef *e;
1329 int op;
1330
1331 if ( !immediateType && CheckToken( "~" ) ) {
1332 e = GetExpression( TILDE_PRIORITY );
1333 switch( e->Type() ) {
1334 case ev_float :
1335 op = OP_COMP_F;
1336 break;
1337
1338 default :
1339 Error( "type mismatch for ~" );
1340
1341 // shut up compiler
1342 op = OP_COMP_F;
1343 break;
1344 }
1345
1346 return EmitOpcode( op, e, 0 );
1347 }
1348
1349 if ( !immediateType && CheckToken( "!" ) ) {
1350 e = GetExpression( NOT_PRIORITY );
1351 switch( e->Type() ) {
1352 case ev_boolean :
1353 op = OP_NOT_BOOL;
1354 break;
1355
1356 case ev_float :
1357 op = OP_NOT_F;
1358 break;
1359
1360 case ev_string :
1361 op = OP_NOT_S;
1362 break;
1363
1364 case ev_vector :
1365 op = OP_NOT_V;
1366 break;
1367
1368 case ev_entity :
1369 op = OP_NOT_ENT;
1370 break;
1371
1372 case ev_function :
1373 Error( "Invalid type for !" );
1374
1375 // shut up compiler
1376 op = OP_NOT_F;
1377 break;
1378
1379 case ev_object :
1380 op = OP_NOT_ENT;
1381 break;
1382
1383 default :
1384 Error( "type mismatch for !" );

Callers

nothing calls this directly

Calls 3

ErrorFunction · 0.50
TypeMethod · 0.45
SetTypeDefMethod · 0.45

Tested by

no test coverage detected