mirror of
https://github.com/YosysHQ/yosys
synced 2025-11-07 14:55:07 +00:00
libparse: fix space before closing paren in expressions
This commit is contained in:
parent
547e254a9b
commit
4fac7a1b20
2 changed files with 9 additions and 4 deletions
|
|
@ -191,7 +191,7 @@ LibertyExpression LibertyExpression::parse(Lexer &s, int min_prio) {
|
|||
char c = s.peek();
|
||||
auto lhs = LibertyExpression{};
|
||||
|
||||
while (isspace(c)) {
|
||||
while (isspace(c) || c == '"') {
|
||||
if (s.empty())
|
||||
return lhs;
|
||||
s.next();
|
||||
|
|
@ -221,7 +221,6 @@ LibertyExpression LibertyExpression::parse(Lexer &s, int min_prio) {
|
|||
warn(ss.str());
|
||||
return lhs;
|
||||
}
|
||||
|
||||
while (true) {
|
||||
if (s.empty())
|
||||
break;
|
||||
|
|
@ -264,9 +263,10 @@ LibertyExpression LibertyExpression::parse(Lexer &s, int min_prio) {
|
|||
s.next();
|
||||
c = s.peek();
|
||||
}
|
||||
if (char_is_nice_binop(c)) {
|
||||
if (char_is_nice_binop(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
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue