DIRECTOR: LINGO: Add eval arg to Lingo::pop/peek

This commit is contained in:
djsrv 2020-08-18 15:19:48 -04:00
parent d180343a16
commit b19569eb39
2 changed files with 6 additions and 6 deletions

View File

@ -192,23 +192,23 @@ void Lingo::pushVoid() {
push(d);
}
Datum Lingo::pop(void) {
Datum Lingo::pop(bool eval) {
assert (_stack.size() != 0);
Datum ret = _stack.back();
_stack.pop_back();
if (ret.lazy) {
if (eval && ret.lazy) {
ret = ret.eval();
}
return ret;
}
Datum Lingo::peek(uint offset) {
Datum Lingo::peek(uint offset, bool eval) {
assert (_stack.size() > offset);
Datum ret = _stack[_stack.size() - 1 - offset];
if (ret.lazy) {
if (eval && ret.lazy) {
ret = ret.eval();
}
return ret;

View File

@ -437,8 +437,8 @@ private:
public:
void push(Datum d);
Datum pop(void);
Datum peek(uint offset);
Datum pop(bool eval = true);
Datum peek(uint offset, bool eval = true);
public:
Common::HashMap<uint32, const char *> _eventHandlerTypes;