3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-04-20 07:36:39 +00:00

dead end, backtracking

This commit is contained in:
Emil J. Tywoniak 2024-06-12 19:30:55 +02:00
parent 919e2103c9
commit 33987d975e

View file

@ -1723,6 +1723,8 @@ public:
throw std::out_of_range("FakeParams.iterator::operator*()");
}
}
// std::pair<IdString, Const&> operator->() { return operator*(); }
// const std::pair<IdString, Const&> operator->() const { return operator*(); }
const std::pair<IdString, Const&> operator*() const {
if (parent->is_legacy()) {
auto it = parent->legacy->parameters.begin();
@ -1893,6 +1895,8 @@ public:
throw std::out_of_range("FakeConns.iterator::operator*()");
}
}
// std::pair<IdString, SigSpec&> operator->() { return operator*(); }
// const std::pair<IdString, SigSpec&> operator->() const { return operator*(); }
const std::pair<IdString, SigSpec&> operator*() const {
if (parent->is_legacy()) {
auto it = parent->legacy->connections_.begin();
@ -1915,6 +1919,12 @@ public:
iterator begin() {
return iterator(parent, 0);
}
// Stupid impl, but rarely used, so I don't want to think about it rn
iterator find(IdString name) {
auto it = iterator(parent, 0);
for (; it != end() && (*it).first != name; ++it) {}
return it;
}
iterator end() {
if (parent->is_legacy()) {
return iterator(parent, parent->legacy->connections_.size());