Apply autofix suggestions from code review

Co-authored-by: Wilson Snyder <wsnyder@wsnyder.org>
This commit is contained in:
Bartłomiej Chmiel 2025-11-05 08:25:10 -05:00 committed by GitHub
parent 61a1dd9531
commit 37f0bd87d3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 7 additions and 9 deletions

View File

@ -108,9 +108,8 @@ class AssertPropertiesParser final : public VNVisitorConst {
// STATE
std::unique_ptr<V3Graph> m_graphp = std::make_unique<V3Graph>(); // Property tree
DfaVertex* m_lastp = nullptr; // Last encountered vertex
bool m_underSExpr
= false; // Whether it is under sequence expression for creating a start node
size_t m_underLogNots = 0; // Number of not operators before sequence
bool m_underSExpr = false; // Is under sequence expression, for creating a start node
size_t m_underLogNots = 0; // Number of 'not' operators before sequence
// VISITORS
void visit(AstNodeCoverOrAssert* nodep) override { iterateChildrenConst(nodep); }

View File

@ -7015,7 +7015,7 @@ class WidthVisitor final : public VNVisitor {
iterateCheckBool(nodep, "LHS", nodep->op1p(), BOTH);
nodep->dtypeSetBit();
if (m_underSExpr) {
nodep->v3error("Unexpected not in sequence expression context");
nodep->v3error("Unexpected 'not' in sequence expression context");
AstConst* const newp = new AstConst{nodep->fileline(), 0};
newp->dtypeFrom(nodep);
nodep->replaceWith(newp);

View File

@ -6534,7 +6534,8 @@ pexpr<nodeExprp>: // IEEE: property_expr (The name pexpr is important as regex
// // IEEE: '(' pexpr ')'
// // Expanded below
//
yNOT pexpr { $$ = new AstLogNot{$1, $2}; }
yNOT pexpr
{ $$ = new AstLogNot{$1, $2}; }
| ySTRONG '(' sexpr ')'
{ $$ = $3; BBUNSUP($2, "Unsupported: strong (in property expression)"); }
| yWEAK '(' sexpr ')'
@ -6622,15 +6623,13 @@ sexpr<nodeExprp>: // ==IEEE: sequence_expr (The name sexpr is important as reg
// // IEEE: "sequence_expr cycle_delay_range sequence_expr { cycle_delay_range sequence_expr }"
// // Both rules basically mean we can repeat sequences, so make it simpler:
cycle_delay_range ~p~sexpr %prec yP_POUNDPOUND
{ $$ = new AstSExpr{$<fl>1, $1, $2};
{ $$ = new AstSExpr{$<fl>1, $1, $2};
if (VN_IS($2, LogNot)) {
BBUNSUP($2->fileline(), "Unexpected not in sequence expression context");
}
}
| ~p~sexpr cycle_delay_range sexpr %prec prPOUNDPOUND_MULTI
{
$$ = new AstSExpr{$<fl>2, $1, $2, $3};
}
{ $$ = new AstSExpr{$<fl>2, $1, $2, $3}; }
//
// // IEEE: expression_or_dist [ boolean_abbrev ]
// // Note expression_or_dist includes "expr"!