ok fix for realsies

This commit is contained in:
lizzie
2026-09-02 23:30:50 +00:00
parent 4fc754a5b7
commit 018210b756
+6 -7
View File
@@ -253,7 +253,7 @@ void IPSwitchCompiler::Parse(std::span<u8 const> bytes) {
// now make a nominal preprocessed line: remove comments // now make a nominal preprocessed line: remove comments
char quote = '\0'; char quote = '\0';
auto const sline_start = p; auto const sline_start = p;
const char *last_space = p; auto last_char = p;
for (; p < sline.cend(); ) { for (; p < sline.cend(); ) {
// we dont check for "//", IPS checks for '/' only... // we dont check for "//", IPS checks for '/' only...
if (std::isspace(*p)) { if (std::isspace(*p)) {
@@ -264,20 +264,19 @@ void IPSwitchCompiler::Parse(std::span<u8 const> bytes) {
} else if (p[0] == '\"' || p[0] == '\'') { } else if (p[0] == '\"' || p[0] == '\'') {
quote = (p[0] == quote) ? '\0' : p[0]; quote = (p[0] == quote) ? '\0' : p[0];
++p; ++p;
last_space = p; last_char = p;
} else if (p + 1 < sline.cend() && p[0] == '\\') { } else if (p + 1 < sline.cend() && p[0] == '\\') {
p += 2; p += 2;
last_space = p; last_char = p;
} else { } else {
++p; ++p;
last_space = p; last_char = p;
} }
} }
// now we have the preprocessed string ;) // now we have the preprocessed string ;)
std::string_view pp_str(sline_start, last_space); std::string_view const pp_str(sline_start, last_char);
if (pp_str.size() > 0 && !parse_line(pp_str)) { if (pp_str.size() > 0 && !parse_line(pp_str))
break; break;
}
} }
} }
} }