Add warning for stray standalone is statements#431
Add warning for stray standalone is statements#431lwaern-intel wants to merge 7 commits intointel:mainfrom
Conversation
py/dml/messages.py
Outdated
| or | ||
| ``` | ||
| field f @ [31:0]; | ||
| is read_only; |
There was a problem hiding this comment.
as you could probably guess it's this second part that first led me down the lexpos rabbit hole. though when I realized it was also why all error messages have been screwed up since forever, it kinda got personal
|
DML Verification : 6: ❌ failure |
|
DML Verification : 7: ❌ failure |
f9566ba to
16131c6
Compare
|
PR Verification: ❌ failure |
|
PR Verification: ✅ success |
|
Dealing with lexical details from the parser has a somewhat unhygienic smell about it; perhaps a different approach might be to do an isolated check on lexer level, essentially the equivalent of
|
16131c6 to
abb7346
Compare
abb7346 to
1250a27
Compare
|
PR Verification: ✅ success |
|
PR Verification: ✅ success |
3659e2f to
67dc202
Compare
The Working on the In addition I'll note this is not completely without precedence, as |
There was a problem hiding this comment.
Pull request overview
This PR improves source-location accuracy in the DML parser (especially around empty productions) and adds a new warning to catch likely-mistaken standalone is statements that appear to be intended to modify the immediately preceding object declaration.
Changes:
- Track the latest lexed token during parsing and fix up
lexposfor empty productions to improve reported line/column locations. - Add warning
WSTRAYISplus parser-side detection to flag suspicious standaloneisstatements. - Add regression tests (DML error test + Python unit test) and document the behavior in release notes.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| test/1.4/errors/T_WSTRAYIS.dml | Adds an errors/warnings test case covering the new WSTRAYIS warning. |
| RELEASENOTES.md | Documents the lexpos fix impact and the new stray-is warning. |
| py/dml/toplevel.py | Passes a custom tokenfunc into PLY parsing to enable latest-token tracking. |
| py/dml/messages.py | Introduces the WSTRAYIS warning definition and message text. |
| py/dml/logging.py | Adds colno to Site and adjusts FileInfo state serialization and column calculation. |
| py/dml/dmlparse.py | Implements empty-production lexpos fixups and adds the stray-is detection pass. |
| py/dml/dmlparse_test.py | Adds unit tests to enforce empty-production fixups and validate site/column behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
67dc202 to
b59c88b
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
b59c88b to
085765a
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
181d853 to
e8c9923
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
PR Verification: ✅ success |
Otherwise the parsetab may be built implicitly when dmlparse_test is run
Fixup function should not be called on nonempty rules Also rewrite as unittest
Previous iteration went with the stance of "as long as multiple declarations are on the same line, assume SOMETHING is messed up, no matter what the declarations are." This is not necessarily a wrong stance to take, trouble is that in those cases emitting `WSTRAYIS` runs a risk of hurting rather than helping; see the updated tests.
e8c9923 to
b9e5e66
Compare
|
PR Verification: ✅ success |
Depends on #430; only the latter two commits shown in this PR are relevant for review.