Skip to content

Commit

Permalink
Fix [*] and ##[*] operator range minimums to be 0 (#1192)
Browse files Browse the repository at this point in the history
  • Loading branch information
georgerennie authored Dec 24, 2024
1 parent e550187 commit 55598e7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions source/ast/expressions/AssertionExpr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,10 @@ SequenceRepetition::SequenceRepetition(const SequenceRepetitionSyntax& syntax,
kind = Consecutive;
range.min = 1;
return;
case TokenKind::Star:
kind = Consecutive;
range.min = 0;
break;
default:
kind = Consecutive;
break;
Expand Down Expand Up @@ -664,6 +668,9 @@ AssertionExpr& SequenceConcatExpr::fromSyntax(const DelayedSequenceExprSyntax& s
delay = SequenceRange::fromSyntax(*es->range, context,
/* allowUnbounded */ true);
}
else if (es->op.kind == TokenKind::Star) {
delay.min = 0;
}
else if (es->op.kind == TokenKind::Plus) {
delay.min = 1;
}
Expand Down

0 comments on commit 55598e7

Please sign in to comment.