diff options
author | Alyssa Milburn | 2011-06-24 21:10:49 +0200 |
---|---|---|
committer | Alyssa Milburn | 2011-06-24 21:10:49 +0200 |
commit | 2b03a3a0e6569cd4a6b940304a4582860a97789f (patch) | |
tree | 228620a6f3a83ca3145e2ad130ddc813a7de55ba | |
parent | 685934ee4aea2b46b117f6c9351d500484b9ec6a (diff) | |
download | scummvm-rg350-2b03a3a0e6569cd4a6b940304a4582860a97789f.tar.gz scummvm-rg350-2b03a3a0e6569cd4a6b940304a4582860a97789f.tar.bz2 scummvm-rg350-2b03a3a0e6569cd4a6b940304a4582860a97789f.zip |
MOHAWK: Handle ++/-- operators in LBCode.
-rw-r--r-- | engines/mohawk/livingbooks_code.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/engines/mohawk/livingbooks_code.cpp b/engines/mohawk/livingbooks_code.cpp index 5ae0e22560..8791fc4330 100644 --- a/engines/mohawk/livingbooks_code.cpp +++ b/engines/mohawk/livingbooks_code.cpp @@ -441,6 +441,33 @@ void LBCode::parseMain() { } break; + case kTokenPlusPlus: + case kTokenMinusMinus: + { + byte token = _currToken; + if (token == kTokenPlusPlus) + debugN("++"); + else + debugN("--"); + nextToken(); + + if (_currToken != kTokenIdentifier) + error("expected identifier"); + assert(_currValue.type == kLBValueString); + Common::String varname = _currValue.string; + debugN("%s", varname.c_str()); + LBValue &val = _vm->_variables[varname]; + + // FIXME: pre/postincrement for non-integers + if (token == kTokenPlusPlus) + val.integer++; + else + val.integer--; + _stack.push(val); + nextToken(); + } + break; + case kTokenLiteral: case kTokenConstMode: case kTokenConstEventId: |