check if characters are found and use size if not

This commit is contained in:
Peter Gadfort 2025-01-29 15:56:05 -05:00
parent aaa5347494
commit 9534f4ab80
1 changed files with 4 additions and 0 deletions

View File

@ -59,6 +59,10 @@ namespace Yosys
std::string pin() {
auto length = s.find_first_of("\t()'!^*& +|");
if (length == std::string::npos) {
// nothing found so use size of s
length = s.size();
}
auto pin = s.substr(0, length);
s = s.substr(length, s.size());
return pin;