mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-12 20:18:20 +00:00
check for regex errors
This commit is contained in:
parent
70db8e9200
commit
419e67c170
|
@ -151,22 +151,26 @@ struct LoggerPass : public Pass {
|
||||||
if (type=="error" && count!=1)
|
if (type=="error" && count!=1)
|
||||||
log_cmd_error("Expected error message occurrences must be 1 !\n");
|
log_cmd_error("Expected error message occurrences must be 1 !\n");
|
||||||
log("Added regex '%s' for warnings to expected %s list.\n", pattern.c_str(), type.c_str());
|
log("Added regex '%s' for warnings to expected %s list.\n", pattern.c_str(), type.c_str());
|
||||||
if (type=="error")
|
try {
|
||||||
log_expect_error.push_back(std::make_pair(std::regex(pattern,
|
if (type=="error")
|
||||||
std::regex_constants::nosubs |
|
log_expect_error.push_back(std::make_pair(std::regex(pattern,
|
||||||
std::regex_constants::optimize |
|
std::regex_constants::nosubs |
|
||||||
std::regex_constants::egrep), LogExpectedItem(pattern, count)));
|
std::regex_constants::optimize |
|
||||||
else if (type=="warning")
|
std::regex_constants::egrep), LogExpectedItem(pattern, count)));
|
||||||
log_expect_warning.push_back(std::make_pair(std::regex(pattern,
|
else if (type=="warning")
|
||||||
std::regex_constants::nosubs |
|
log_expect_warning.push_back(std::make_pair(std::regex(pattern,
|
||||||
std::regex_constants::optimize |
|
std::regex_constants::nosubs |
|
||||||
std::regex_constants::egrep), LogExpectedItem(pattern, count)));
|
std::regex_constants::optimize |
|
||||||
else
|
std::regex_constants::egrep), LogExpectedItem(pattern, count)));
|
||||||
log_expect_log.push_back(std::make_pair(std::regex(pattern,
|
else
|
||||||
std::regex_constants::nosubs |
|
log_expect_log.push_back(std::make_pair(std::regex(pattern,
|
||||||
std::regex_constants::optimize |
|
std::regex_constants::nosubs |
|
||||||
std::regex_constants::egrep), LogExpectedItem(pattern, count)));
|
std::regex_constants::optimize |
|
||||||
|
std::regex_constants::egrep), LogExpectedItem(pattern, count)));
|
||||||
|
}
|
||||||
|
catch (const std::regex_error& e) {
|
||||||
|
log_cmd_error("Error in regex expression '%s' !\n", pattern.c_str());
|
||||||
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (args[argidx] == "-expect-no-warnings") {
|
if (args[argidx] == "-expect-no-warnings") {
|
||||||
|
|
Loading…
Reference in a new issue