File tree Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -44,21 +44,22 @@ bool Arch::apply_lpf(std::string filename, std::istream &in)
44
44
auto isempty = [](const std::string &str) {
45
45
return std::all_of (str.begin (), str.end (), [](char c) { return isblank (c) || c == ' \r ' || c == ' \n ' ; });
46
46
};
47
- auto strip_quotes = [](const std::string &str) {
48
- if (str.at (0 ) == ' "' ) {
49
- NPNR_ASSERT (str.back () == ' "' );
50
- return str.substr (1 , str.size () - 2 );
51
- } else {
52
- return str;
53
- }
54
- };
55
-
56
47
try {
57
48
if (!in)
58
49
log_error (" failed to open LPF file\n " );
59
50
std::string line;
60
51
std::string linebuf;
61
52
int lineno = 0 ;
53
+ auto strip_quotes = [&](const std::string &str) {
54
+ if (str.at (0 ) == ' "' ) {
55
+ if (str.back () != ' "' ) {
56
+ log_error (" expected '\" ' at end of string '%s' (on line %d)\n " , str.c_str (), lineno);
57
+ }
58
+ return str.substr (1 , str.size () - 2 );
59
+ } else {
60
+ return str;
61
+ }
62
+ };
62
63
while (std::getline (in, line)) {
63
64
++lineno;
64
65
size_t cstart = line.find (' #' );
You can’t perform that action at this time.
0 commit comments