diff options
author | Eugene Sandulenko | 2019-12-07 11:08:47 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2019-12-07 11:09:22 +0100 |
commit | ba42af45db156ae8a334c3d1275b3070e2077e37 (patch) | |
tree | 50632e70ca82e178ca2e20563f04195ba3f5f86a /engines/director | |
parent | cf5fb4e4ef6923f27c2a3a575a654eabe2be654b (diff) | |
download | scummvm-rg350-ba42af45db156ae8a334c3d1275b3070e2077e37.tar.gz scummvm-rg350-ba42af45db156ae8a334c3d1275b3070e2077e37.tar.bz2 scummvm-rg350-ba42af45db156ae8a334c3d1275b3070e2077e37.zip |
DIRECTOR: LINGO: Give better name to the code preprocessor
Diffstat (limited to 'engines/director')
-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 |