Skip to content

Unreachable code now causes a warning.#606

Merged
hildjj merged 3 commits intopeggyjs:mainfrom
hildjj:unreachable
Apr 24, 2025
Merged

Unreachable code now causes a warning.#606
hildjj merged 3 commits intopeggyjs:mainfrom
hildjj:unreachable

Conversation

@hildjj
Copy link
Copy Markdown
Contributor

@hildjj hildjj commented Apr 23, 2025

Adds a "semantic" pass to the compiler, right before code generation, for rules that need to rely on
node.match being in place, and depend on all
other transformations having already run.

Most of a fix for #576, without full static analysis.

Adds a "semantic" pass to the compiler, right before
code generation, for rules that need to rely on
node.match being in place, and depend on all
other transformations having already run.

Most of a fix for peggyjs#576, without full static analysis.
@hildjj hildjj marked this pull request as ready for review April 23, 2025 22:17
@hildjj hildjj requested a review from Mingun April 23, 2025 22:17
Copy link
Copy Markdown
Member

@Mingun Mingun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I'm not missing something, you still need to do recursive call in visitor functions, otherwise you will catch problems only in the rule, but not inside ... / ..., for example.

@hildjj hildjj merged commit 759fb74 into peggyjs:main Apr 24, 2025
10 checks passed
@hildjj hildjj deleted the unreachable branch April 24, 2025 15:01
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.

2 participants