Skip to content

Commit 75e1126

Browse files
authored
[#10] Tweaked the regexes a bit, and tried strongarming the compiler into compliance.
1 parent 4f2d635 commit 75e1126

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

source/game/scripts/manager.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -404,17 +404,15 @@ void parseFile(Manager* man, File& fl, const std::string& filename, bool cacheFi
404404
reg_compile(pre_import_from, "^[ \t]*from[ \t]+([A-Za-z0-9._-]+)[ \t]+import[ \t]+([^;]+);");
405405
reg_compile(pre_import_all, "^[ \t]*import[ \t]+(([A-Za-z0-9._-]|, )+);");
406406
reg_compile(pre_export, "^[ \t]*export[ \t]+(([A-Za-z0-9._-]|,* )+);");
407-
reg_compile(pre_osr_single_line, "(.*)///([0-9]*)-?([0-9]*)(.*)");
408-
reg_compile(pre_osr_multi_open, "(.*)/\*\*([0-9]*)-?([0-9]*)(.*)");
409-
reg_compile(pre_osr_multi_close, "(.*)[ \t]([0-9]*)-?([0-9]*)\*\*/(.*)");
407+
reg_compile(pre_osr_single_line, "(.*)//\$([0-9]*)-?([0-9]*)(.*)");
408+
reg_compile(pre_osr_multi_open, "(.*)/\*\$([0-9]*)-?([0-9]*)(.*)");
409+
reg_compile(pre_osr_multi_close, "(.*)[ \t]([0-9]*)-?([0-9]*)\$\*/(.*)");
410410
reg_compile_lock.release();
411411
reg_result match;
412412

413413

414414
for(auto iLine = lines.begin(), end = lines.end(); iLine != end; ++iLine) {
415-
const std::string& originalLine = *iLine;
416-
// I'm not actually sure if this amounts to a meaningful optimization... or any optimization.
417-
std::string& line = originalLine;
415+
std::string& line = *iLine;
418416

419417
auto lineStart = line.find_first_not_of(" \t");
420418
if(lineStart == std::string::npos) {

0 commit comments

Comments
 (0)