Skip to content

Fix: reject implicit data types in data_declaration#119

Merged
dalance merged 1 commit into
dalance:masterfrom
0ncorhynchus:fix_data_declaration
Mar 30, 2026
Merged

Fix: reject implicit data types in data_declaration#119
dalance merged 1 commit into
dalance:masterfrom
0ncorhynchus:fix_data_declaration

Conversation

@0ncorhynchus

Copy link
Copy Markdown
Contributor

This PR fixes #118.

Summary

This change ensures that implicit data types in data_declaration are rejected unless the var keyword is explicitly used.
This aligns the parser behavior with the SystemVerilog standard and prevents ambiguous parsing inside procedural blocks.

Changes

  • Add verify logic to reject implicit data types in data_declaration_variable when var is not used.
  • Add unit tests validating the updated behavior.
  • Update several spec tests to reflect correct SystemVerilog parsing rules.

Notes on Spec Tests

Some spec tests were previously validating the parsing of procedural assignments as module_items.
However, such statements are illegal at the module scope according to the SystemVerilog LRM.

This incorrect behavior was caused by treating identifier-leading procedural assignments as implicit declarations.

This PR corrects that behavior, and the affected spec tests have been updated accordingly.

@dalance

dalance commented Mar 30, 2026

Copy link
Copy Markdown
Owner

Thank you for your contribution!
I'll merge this PR.

@dalance
dalance merged commit 9a329a5 into dalance:master Mar 30, 2026
1 check passed
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.

Incorrect parsing of procedural assignment inside procedural block

2 participants