diff options
author | Alyssa Milburn | 2013-04-19 00:32:49 +0200 |
---|---|---|
committer | Alyssa Milburn | 2013-04-19 00:32:49 +0200 |
commit | 541a0b8c69d27b331b0f05d1eae4abb661c4d897 (patch) | |
tree | d1aa4ed422992ea4a2e1abece76b74366903e9cf | |
parent | aa1fe8a1612c743a58b3d31bd34c61c626d53b79 (diff) | |
download | scummvm-rg350-541a0b8c69d27b331b0f05d1eae4abb661c4d897.tar.gz scummvm-rg350-541a0b8c69d27b331b0f05d1eae4abb661c4d897.tar.bz2 scummvm-rg350-541a0b8c69d27b331b0f05d1eae4abb661c4d897.zip |
MOHAWK: Implement LB's kTokenEval.
-rw-r--r-- | engines/mohawk/livingbooks_code.cpp | 18 | ||||
-rw-r--r-- | engines/mohawk/livingbooks_code.h | 1 |
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, |