diff options
-rw-r--r-- | engines/director/lingo/lingo.cpp | 6 | ||||
-rw-r--r-- | engines/director/lingo/lingo.h | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/engines/director/lingo/lingo.cpp b/engines/director/lingo/lingo.cpp index a09f227721..cb6bd876a9 100644 --- a/engines/director/lingo/lingo.cpp +++ b/engines/director/lingo/lingo.cpp @@ -154,7 +154,7 @@ void Lingo::addCode(const char *code, ScriptType type, uint16 id) { } // Strip comments for ease of the parser - Common::String codeNorm = stripComments(code); + Common::String codeNorm = codePreprocessor(code); code = codeNorm.c_str(); begin = code; @@ -247,7 +247,7 @@ static Common::String prevtok(const char *s, const char *lineStart, const char * return res; } -Common::String Lingo::stripComments(const char *s) { +Common::String Lingo::codePreprocessor(const char *s) { Common::String res; // Strip comments @@ -298,6 +298,8 @@ Common::String Lingo::stripComments(const char *s) { res.clear(); // Preprocess if statements + // Here we add ' end if' at end of each statement, which lets us + // make the grammar very straightforward Common::String line, tok; const char *lineStart, *prevEnd; int iflevel = 0; diff --git a/engines/director/lingo/lingo.h b/engines/director/lingo/lingo.h index d15ade5335..9cd0c21afb 100644 --- a/engines/director/lingo/lingo.h +++ b/engines/director/lingo/lingo.h @@ -183,7 +183,7 @@ public: void runTests(); private: - Common::String stripComments(const char *s); + Common::String codePreprocessor(const char *s); const char *findNextDefinition(const char *s); // lingo-events.cpp |