DIRECTOR: LINGO: Make var undefined warning stricter

Now it only warns if the var is inside a definition. If it's in
scopeless Lingo, it should be fine.
This commit is contained in:
djsrv 2021-06-21 16:26:12 -04:00 committed by D.J. Servilla
parent 150e819d3f
commit fee4e419f8

View File

@ -295,7 +295,8 @@ void LingoCompiler::codeVarRef(const Common::String &name) {
if (_methodVars->contains(name)) {
type = (*_methodVars)[name];
} else {
warning("BUILDBOT: LingoCompiler::codeVarRef: var %s referenced before definition", name.c_str());
if (_indef)
warning("BUILDBOT: LingoCompiler::codeVarRef: var %s referenced before definition", name.c_str());
type = kVarGeneric;
}
switch (type) {
@ -322,7 +323,8 @@ void LingoCompiler::codeVarGet(const Common::String &name) {
if (_methodVars->contains(name)) {
type = (*_methodVars)[name];
} else {
warning("BUILDBOT: LingoCompiler::codeVarGet: var %s referenced before definition", name.c_str());
if (_indef)
warning("BUILDBOT: LingoCompiler::codeVarGet: var %s referenced before definition", name.c_str());
type = kVarGeneric;
}
switch (type) {