3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-04-24 01:25:33 +00:00

Add more Liberty tests and fix parentheses in functions

This commit is contained in:
Akash Levy 2024-11-05 10:34:51 -08:00
parent 4a5e33520b
commit c2f95d1b5a
7 changed files with 208 additions and 2 deletions

View file

@ -236,9 +236,12 @@ LibertyAst *LibertyParser::parse()
if (tok == 'v') {
tok = lexer(str);
}
while (tok == '+' || tok == '-' || tok == '*' || tok == '/' || tok == '!') {
while (tok == '(' || tok == ')' || tok == '+' || tok == '-' || tok == '*' || tok == '/' || tok == '!') { // SILIMATE: added parentheses
ast->value += tok;
tok = lexer(str);
if (tok == ')') { // SILIMATE: semicolon may follow close parenthesis
tok = lexer(str);
if (tok == ';') break;
} else tok = lexer(str);
if (tok != 'v')
error();
ast->value += str;