mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-13 04:28:37 +00:00
DIRECTOR: LINGO: Give better name to the code preprocessor
This commit is contained in:
parent
cf5fb4e4ef
commit
ba42af45db
@ -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;
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user