DIRECTOR: LINGO: Give better name to the code preprocessor

This commit is contained in:
Eugene Sandulenko 2019-12-07 11:08:47 +01:00
parent cf5fb4e4ef
commit ba42af45db
2 changed files with 5 additions and 3 deletions

View File

@ -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;

View File

@ -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