MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / Vyhod

Method Vyhod

engine/Evaluator/express.cpp:1558–1864  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1556};
1557
1558GameValue GameState::Vyhod() const
1559{
1560 const GameFunctions* functions;
1561 const GameOperators* operators;
1562 _e->_parPrior = 0;
1563 _e->_listPrior = 0;
1564 _e->SP = 0;
1565 _e->_error = EvalOK;
1566 _e->_errorText = RString();
1567 if (*_e->_pos == ';' || *_e->_pos == 0)
1568 {
1569 // detect empty expression
1570 return NOTHING;
1571 }
1572 for (;;)
1573 {
1574 vynech();
1575 if (*_e->_pos == '(')
1576 {
1577 _e->_pos++;
1578 _e->_parPrior += zavorky;
1579 continue;
1580 }
1581 if (*_e->_pos == '[')
1582 {
1583 // evaluate list - no recursion?
1584 _e->_pos++;
1585 vynech();
1586 if (*_e->_pos == ']')
1587 {
1588 // empty list construction
1589 _e->_pos++;
1590
1591 if (_e->SP >= SL)
1592 {
1593 SetError(EvalLineLong);
1594 return NOTHING;
1595 }
1596 _e->_stack[_e->SP] = GameArrayType();
1597 _e->_priorStack[_e->SP] = -1;
1598 _e->UB[_e->SP] = -1;
1599 _e->_operStack[_e->SP] = GetBinOp();
1600 _e->SP++;
1601
1602 goto CekejBinar;
1603 }
1604 else
1605 {
1606 _e->_listPrior += zavorky;
1607 }
1608 continue;
1609 }
1610 // check unary operator -
1611 functions = nullptr;
1612 if (isalpha(*_e->_pos))
1613 {
1614 // scan identifier
1615 int idlen = 0;

Callers

nothing calls this directly

Calls 9

isalnumextFunction · 0.85
isalphaextFunction · 0.85
LowerMethod · 0.80
GameValueClass · 0.70
RStringClass · 0.50
SetErrorFunction · 0.50
IsNullMethod · 0.45
ReallocMethod · 0.45
AddMethod · 0.45

Tested by

no test coverage detected