Skip to content

Require a semicolon after package-scoped event triggers - #1675

Merged
larsclausen merged 3 commits into
steveicarus:masterfrom
larsclausen:parser-package-event-trigger
Oct 28, 2026
Merged

larsclausen merged 3 commits into
steveicarus:masterfrom
larsclausen:parser-package-event-trigger

Conversation

@larsclausen

Copy link
Copy Markdown
Collaborator

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.

The current parser's 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>
@larsclausen
larsclausen force-pushed the parser-package-event-trigger branch from e700bcf to 21170fd Compare October 28, 2026 04:38
The current parser accepts `@(p::e)` but rejects `@p::e`. IEEE 1800-2023
A.6.5 permits `@ ps_identifier`, including a package-qualified identifier.

Add the package-qualified identifier alternative to `event_control` and
construct the same event expression as the parenthesized form.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Check that package-scoped events can be triggered and waited on using
`@p::e`. Check triggers used as the direct body of an `if`/`else` statement.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
@larsclausen
larsclausen force-pushed the parser-package-event-trigger branch from 21170fd to f935c0b Compare October 28, 2026 05:08
@larsclausen
larsclausen merged commit fd8759f into steveicarus:master Oct 28, 2026
8 checks passed
@larsclausen
larsclausen deleted the parser-package-event-trigger branch October 28, 2026 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant