mirror of
https://github.com/YosysHQ/yosys
synced 2025-06-12 09:03:27 +00:00
More sloppiness, thanks @dh73 for spotting
This commit is contained in:
parent
db0003410f
commit
4158ce4eda
1 changed files with 4 additions and 4 deletions
|
@ -331,11 +331,11 @@ struct rules_t
|
||||||
if (GetSize(tokens) >= 2 && tokens[0] == "attribute") {
|
if (GetSize(tokens) >= 2 && tokens[0] == "attribute") {
|
||||||
data.attributes.emplace_back();
|
data.attributes.emplace_back();
|
||||||
for (int idx = 1; idx <= GetSize(tokens)-1; idx++) {
|
for (int idx = 1; idx <= GetSize(tokens)-1; idx++) {
|
||||||
size_t c1 = tokens[1][0] == '!' ? 1 : 0;
|
size_t c1 = tokens[idx][0] == '!' ? 1 : 0;
|
||||||
size_t c2 = tokens[1].find("=");
|
size_t c2 = tokens[idx].find("=");
|
||||||
bool exists = (c1 == 0);
|
bool exists = (c1 == 0);
|
||||||
IdString key = RTLIL::escape_id(tokens[1].substr(c1, c2));
|
IdString key = RTLIL::escape_id(tokens[idx].substr(c1, c2));
|
||||||
Const val = c2 != std::string::npos ? tokens[1].substr(c2+1) : RTLIL::Const(1);
|
Const val = c2 != std::string::npos ? tokens[idx].substr(c2+1) : RTLIL::Const(1);
|
||||||
|
|
||||||
data.attributes.back().emplace_back(exists, key, val);
|
data.attributes.back().emplace_back(exists, key, val);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue