Fixed building on MSVC

This commit is contained in:
Bartek Kryza
2023-05-28 22:17:21 +02:00
parent 0028cf6f3d
commit 8e801fe31d
11 changed files with 47 additions and 66 deletions

View File

@@ -745,8 +745,19 @@ bool parse_source_location(const std::string &location_str, std::string &file,
return false;
file = tokens.at(0);
line = std::stoi(tokens.at(1));
column = std::stoi(tokens.at(2));
try {
line = std::stoi(tokens.at(1));
}
catch(std::invalid_argument &e) {
line = 0;
}
try {
column = std::stoi(tokens.at(2));
}
catch(std::invalid_argument &e) {
column = 0;
}
return true;
}