MCPcopy Create free account
hub / github.com/TASEmulators/fceux / Term

Function Term

src/conddebug.cpp:394–447  ·  view source on GitHub ↗

Handle * and / operators */

Source from the content-addressed store, hash-verified

392
393/* Handle * and / operators */
394static Condition* Term(const char** str)
395{
396 Condition* t;
397 Condition* t1;
398 Condition* mid;
399
400 t = new Condition();
401
402 if (t == nullptr)
403 {
404 return NULL;
405 }
406
407 if (!Primitive(str, t))
408 {
409 delete t;
410 return 0;
411 }
412
413 while (next == '*' || next == '/')
414 {
415 int op = next == '*' ? OP_MULT : OP_DIV;
416
417 scan(str);
418
419 if ((t1 = new Condition()) == nullptr)
420 {
421 delete t;
422 return nullptr;
423 }
424
425 if (!Primitive(str, t1))
426 {
427 delete t;
428 delete t1;
429 return 0;
430 }
431
432 if ((mid = new Condition()) == nullptr)
433 {
434 delete t;
435 delete t1;
436 return nullptr;
437 }
438
439 mid->lhs = t;
440 mid->rhs = t1;
441 mid->op = op;
442
443 t = mid;
444 }
445
446 return t;
447}
448
449/* Check for + and - operators */
450static int SumOperators(const char** str)

Callers

nothing calls this directly

Calls 2

PrimitiveFunction · 0.85
scanFunction · 0.85

Tested by

no test coverage detected