mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-07 10:21:31 +00:00
DIRECTOR: LINGO: Remove old if code
This commit is contained in:
parent
dac5b6230c
commit
03e6a56c5c
@ -251,37 +251,6 @@ int LingoCompiler::codeFunc(Common::String *s, int numpar) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
void LingoCompiler::codeLabel(int label) {
|
||||
_labelstack.push_back(label);
|
||||
debugC(4, kDebugCompile, "codeLabel: Added label %d", label);
|
||||
}
|
||||
|
||||
void LingoCompiler::processIf(int toplabel, int endlabel) {
|
||||
inst iend;
|
||||
|
||||
debugC(4, kDebugCompile, "processIf(%d, %d)", toplabel, endlabel);
|
||||
|
||||
while (true) {
|
||||
if (_labelstack.empty()) {
|
||||
warning("Lingo::processIf(): Label stack underflow");
|
||||
break;
|
||||
}
|
||||
|
||||
int label = _labelstack.back();
|
||||
_labelstack.pop_back();
|
||||
|
||||
// This is beginning of our if()
|
||||
if (!label)
|
||||
break;
|
||||
|
||||
debugC(4, kDebugCompile, "processIf: label at %d", label);
|
||||
|
||||
WRITE_UINT32(&iend, endlabel - label + 1);
|
||||
|
||||
(*_currentAssembly)[label] = iend; /* end, if cond fails */
|
||||
}
|
||||
}
|
||||
|
||||
void LingoCompiler::registerMethodVar(const Common::String &name, VarType type) {
|
||||
if (!_methodVars->contains(name)) {
|
||||
(*_methodVars)[name] = type;
|
||||
|
@ -46,9 +46,7 @@ public:
|
||||
int codeFloat(double f);
|
||||
int codeFunc(Common::String *s, int numpar);
|
||||
int codeInt(int val);
|
||||
void codeLabel(int label);
|
||||
int codeString(const char *s);
|
||||
void processIf(int toplabel, int endlabel);
|
||||
void registerFactory(Common::String &s);
|
||||
void registerMethodVar(const Common::String &name, VarType type);
|
||||
|
||||
@ -66,8 +64,6 @@ public:
|
||||
Common::HashMap<Common::String, VarType, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> *_methodVars;
|
||||
Common::HashMap<Common::String, VarType, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> *_methodVarsStash;
|
||||
|
||||
Common::Array<int> _labelstack;
|
||||
|
||||
bool _hadError;
|
||||
|
||||
public:
|
||||
|
Loading…
Reference in New Issue
Block a user