From bf29f6dc11630a3d97254bfaed3652fe8be35890 Mon Sep 17 00:00:00 2001 From: "Emil J. Tywoniak" Date: Wed, 5 Nov 2025 12:50:50 +0100 Subject: [PATCH] libparse: tolerate closing quotes in expression parsing --- passes/techmap/libparse.cc | 4 ++-- passes/techmap/libparse.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/passes/techmap/libparse.cc b/passes/techmap/libparse.cc index 6db204c2e..eddc68263 100644 --- a/passes/techmap/libparse.cc +++ b/passes/techmap/libparse.cc @@ -263,10 +263,10 @@ LibertyExpression LibertyExpression::parse(Lexer &s, int min_prio) { s.next(); c = s.peek(); } - if (char_is_nice_binop(c) || c == ')') { + if (char_is_nice_binop(c) || c == ')' || c == '\'' || c == '\"') { // We found a real binop, so this space wasn't an AND // and we just discard it as meaningless whitespace - // Closing paren is also always terminating here + // Tail operators also imply this isn't an AND continue; } } else { diff --git a/passes/techmap/libparse.h b/passes/techmap/libparse.h index f1138567d..674484dad 100644 --- a/passes/techmap/libparse.h +++ b/passes/techmap/libparse.h @@ -63,7 +63,7 @@ namespace Yosys } std::string pin() { - auto length = s.find_first_of("\t()'!^*& +|"); + auto length = s.find_first_of("\t()'!^*& +|\""); if (length == std::string::npos) { // nothing found so use size of s length = s.size();