aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/mohawk/livingbooks_code.cpp18
-rw-r--r--engines/mohawk/livingbooks_code.h1
2 files changed, 19 insertions, 0 deletions
diff --git a/engines/mohawk/livingbooks_code.cpp b/engines/mohawk/livingbooks_code.cpp
index bb8f7a0d05..38719e5e00 100644
--- a/engines/mohawk/livingbooks_code.cpp
+++ b/engines/mohawk/livingbooks_code.cpp
@@ -669,6 +669,24 @@ void LBCode::parseMain() {
_stack.push(_stack.pop().isZero() ? 1 : 0);
break;
+ case kTokenEval:
+ // FIXME: original token?
+ debugN("..");
+ nextToken();
+ parseStatement();
+ if (!_stack.size())
+ error("eval op failed");
+ {
+ // FIXME: XXX
+ LBValue in = _stack.pop();
+ if (in.type != kLBValueString)
+ error("eval op on non-string");
+ Common::String varname = in.string;
+ LBValue &val = _vm->_variables[varname];
+ _stack.push(val);
+ }
+ break;
+
case kTokenGeneralCommand:
runGeneralCommand();
break;
diff --git a/engines/mohawk/livingbooks_code.h b/engines/mohawk/livingbooks_code.h
index 47dd90f814..b2b4772478 100644
--- a/engines/mohawk/livingbooks_code.h
+++ b/engines/mohawk/livingbooks_code.h
@@ -188,6 +188,7 @@ enum {
kTokenConstEventId = 0x42,
kTokenConstScriptOpcode = 0x43, // ??
kTokenConstScriptParam = 0x44, // ??
+ kTokenEval = 0x4b,
kTokenGeneralCommand = 0x4d,
kTokenItemCommand = 0x4e,
kTokenNotifyCommand = 0x4f,