Fix colon-divide operator without space (#6121).

This commit is contained in:
Wilson Snyder 2025-06-25 04:56:52 -04:00
parent 88d0d85ca6
commit 3209bee3b3
3 changed files with 6 additions and 5 deletions

View File

@ -76,6 +76,7 @@ Verilator 5.037 devel
* Fix `--lib-create` with double-underscore (#6099).
* Fix DFG binToOneHot table index missing driver (#6100). [Geza Lore]
* Fix decoding octal string escapes with 1-2 digits (#6108).
* Fix colon-divide operator without space (#6121). [Alex Solomatnikov]
Verilator 5.036 2025-04-27

View File

@ -647,9 +647,9 @@ vnum {vnum1}|{vnum2}|{vnum3}|{vnum4}|{vnum5}
/* Default PLI rule */
<V95,V01NC,V01C,V05,VA5,S05,S09,S12,S17,S23,SAX>{
"$"[a-zA-Z0-9_$]+ { const string str (yytext, yyleng);
yylval.strp = PARSEP->newString(AstNode::encodeName(str));
FL; return yaD_PLI;
}
yylval.strp = PARSEP->newString(AstNode::encodeName(str));
FL; return yaD_PLI;
}
}
/************************************************************************/
@ -896,7 +896,7 @@ vnum {vnum1}|{vnum2}|{vnum3}|{vnum4}|{vnum5}
"@@" { FL; return yP_ATAT; }
"::" { FL; return yP_COLONCOLON; }
":=" { FL; return yP_COLONEQ; }
":/"[^\/\*] { FL; return yP_COLONDIV; } /* : then comment is not ":/" */
":/"/[^\/\*] { FL; return yP_COLONDIV; } /* : then comment is not ":/" */
"|->" { FL; return yP_ORMINUSGT; }
"|=>" { FL; return yP_OREQGT; }
/* Some simulators allow whitespace here. Grr */

View File

@ -28,7 +28,7 @@ class C;
int arr[3] = '{5, 6, 7};
constraint distrib {
x dist { [1:3] := 0, [5:6], [9:15] :/ 0 };
y dist { [1:3] := 0, 5, 6 := 8, [9:15] :/ 0 };
y dist { [1:3] := 0, 5, 6 := 8, [9:15] :/0 }; // /0 intentional to check yP_COLONDIV
x < 20;
};
constraint distinside {