Skip to content

Commit 0f8ce33

Browse files
committed
Require a semicolon after package-scoped event triggers
The package-scoped event trigger production does not consume its trailing semicolon. As a result, `if (cond) -> p::e; else ...` is rejected because the semicolon is parsed as a separate null statement. Omitting the required semicolon incorrectly makes the statement compile. Add the semicolon to the package production, matching the ordinary event trigger and the `event_trigger` grammar in IEEE 1800-2023 A.6.5. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
1 parent d95f240 commit 0f8ce33

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎parse.y‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7719,7 +7719,7 @@ non_block_statement_item
77197719
delete $2;
77207720
$$ = tmp;
77217721
}
7722-
| K_TRIGGER package_scope hierarchy_identifier
7722+
| K_TRIGGER package_scope hierarchy_identifier ';'
77237723
{ lex_in_package_scope(0);
77247724
PTrigger*tmp = pform_new_trigger(@3, $2, *$3);
77257725
delete $3;

0 commit comments

Comments
 (0)