From 21e68ec9be2aa5d2827f5fe0a5ac4004fbf3f58e Mon Sep 17 00:00:00 2001 From: "Emil J. Tywoniak" Date: Tue, 15 Jul 2025 12:53:13 +0200 Subject: [PATCH] libparse: fix space ANDs --- passes/techmap/libparse.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/passes/techmap/libparse.cc b/passes/techmap/libparse.cc index 957a529b9..c6f87b60b 100644 --- a/passes/techmap/libparse.cc +++ b/passes/techmap/libparse.cc @@ -240,7 +240,7 @@ LibertyExpression LibertyExpression::parse(Lexer &s, int min_prio) { if (isspace(c)) { // Rewind past this space and any further spaces - while (isspace(c) && !s.empty()) { + while (isspace(c)) { if (s.empty()) return lhs; s.next(); @@ -257,6 +257,8 @@ LibertyExpression LibertyExpression::parse(Lexer &s, int min_prio) { } auto rhs = parse(s, 4); + if (rhs.kind == EMPTY) + continue; auto n = LibertyExpression{}; n.kind = Kind::AND; n.children.push_back(lhs);