Skip to content

Commit

Permalink
Merge pull request The-OpenROAD-Project#5112 from The-OpenROAD-Projec…
Browse files Browse the repository at this point in the history
…t-staging/gui-regex

gui: switch to boost regex for long src line
  • Loading branch information
maliberty authored May 15, 2024
2 parents 8327880 + e33e7e7 commit 81af039
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/gui/src/drcWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
#include <QVBoxLayout>
#include <array>
#include <boost/property_tree/json_parser.hpp>
#include <boost/regex.hpp>
#include <fstream>
#include <iomanip>
#include <map>
Expand Down Expand Up @@ -521,7 +522,7 @@ void DRCWidget::loadTRReport(const QString& filename)
}

std::regex violation_type("\\s*violation type: (.*)");
std::regex srcs("\\s*srcs: (.*)");
boost::regex srcs("\\s*srcs: (.*)");
std::regex congestion_line("\\s*congestion information: (.*)");
std::regex bbox_layer("\\s*bbox = (.*) on Layer (.*)");
std::regex bbox_corners(
Expand Down Expand Up @@ -557,8 +558,9 @@ void DRCWidget::loadTRReport(const QString& filename)
int source_line_number = line_number;
std::getline(report, line);
std::string sources;
if (std::regex_match(line, base_match, srcs)) {
sources = base_match[1].str();
boost::smatch sources_match;
if (boost::regex_match(line, sources_match, srcs)) {
sources = sources_match[1].str();
} else {
logger_->error(utl::GUI,
46,
Expand Down

0 comments on commit 81af039

Please sign in to comment.