Skip to content

Commit

Permalink
[#10] ... Maybe like this?
Browse files Browse the repository at this point in the history
  • Loading branch information
DaloLorn authored Jan 31, 2025
1 parent 568163f commit df79814
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions source/game/scripts/manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ void parseFile(Manager* man, File& fl, const std::string& filename, bool cacheFi
// TODO: Figure out something a little better-optimized than always running
// three regexes on every line of code?
// On the bright side, we're only running them if we're in the right section...
std::string osrLine = line;
std::string osrLine = new std::string(line);
while(reg_match(osrLine, match, pre_osr_single_line)) {
const std::string prefix = reg_str(osrLine, match, 1);
const std::string postfix = reg_str(osrLine, match, 4);
Expand Down Expand Up @@ -516,6 +516,7 @@ void parseFile(Manager* man, File& fl, const std::string& filename, bool cacheFi

fl.imports.insert(ImportSpec(mod, def));
output += "\n";
delete osrLine;
continue;
}

Expand All @@ -534,6 +535,7 @@ void parseFile(Manager* man, File& fl, const std::string& filename, bool cacheFi
}

output += "\n";
delete osrLine;
continue;
}

Expand All @@ -558,6 +560,7 @@ void parseFile(Manager* man, File& fl, const std::string& filename, bool cacheFi
}

output += "\n";
delete osrLine;
continue;
}

Expand Down Expand Up @@ -616,13 +619,15 @@ void parseFile(Manager* man, File& fl, const std::string& filename, bool cacheFi
error(" Tried %s", includeFile.c_str());
}
output += "\n";
delete osrLine;
continue;
}
}

//Don't include the same file multiple times
if(fl.includes.find(includeFile) != fl.includes.end()) {
output += "\n";
output += "\n";
delete osrLine;
continue;
}

Expand All @@ -647,10 +652,12 @@ void parseFile(Manager* man, File& fl, const std::string& filename, bool cacheFi
}

output.append(1,'\n');
delete osrLine;
}
else {
output += osrLine;
output.append(1,'\n');
delete osrLine;
}
}
}
Expand Down

0 comments on commit df79814

Please sign in to comment.