mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-12 14:09:28 +00:00
DIRECTOR: LINGO: Keep continuations in skipped lines
This should keep line numbers more consistent.
This commit is contained in:
parent
8ac5130740
commit
c716ded122
@ -155,12 +155,15 @@ Common::U32String LingoCompiler::codePreprocessor(const Common::U32String &code,
|
||||
res1.clear();
|
||||
|
||||
// Get next line
|
||||
int continuationCount = 0;
|
||||
while (*s && *s != '\n') { // If we see a whitespace
|
||||
res1 += *s;
|
||||
line += tolower(*s++);
|
||||
|
||||
if (*s == CONTINUATION)
|
||||
if (*s == CONTINUATION) {
|
||||
linenumber++;
|
||||
continuationCount++;
|
||||
}
|
||||
}
|
||||
debugC(2, kDebugParse | kDebugPreprocess, "line: '%s'", line.encode().c_str());
|
||||
|
||||
@ -170,6 +173,9 @@ Common::U32String LingoCompiler::codePreprocessor(const Common::U32String &code,
|
||||
defFound = true;
|
||||
} else {
|
||||
debugC(2, kDebugParse | kDebugPreprocess, "skipping line before first definition");
|
||||
for (int i = 0; i < continuationCount; i++) {
|
||||
res += CONTINUATION;
|
||||
}
|
||||
linenumber++;
|
||||
if (*s) // copy newline symbol
|
||||
res += *s++;
|
||||
|
Loading…
x
Reference in New Issue
Block a user