Skip to content

fix(syn-solidity): parse delete statement as expression, not variable declaration#1087

Merged
DaniPopes merged 1 commit intomainfrom
danipopes/fix-delete-stmt-parsing
Mar 20, 2026
Merged

fix(syn-solidity): parse delete statement as expression, not variable declaration#1087
DaniPopes merged 1 commit intomainfrom
danipopes/fix-delete-stmt-parsing

Conversation

@decofe
Copy link
Contributor

@decofe decofe commented Mar 20, 2026

Fixes #1079.

delete status; was being parsed as a StmtVarDecl with custom type delete because the delete keyword wasn't matched in Stmt::parse_simple, falling through to StmtVarDecl::parse_or_expr. Added a kw::delete peek to route it to Self::Expr instead.

Credit to @nolanv-be for identifying the fix.

Co-Authored-By: DaniPopes 57450786+DaniPopes@users.noreply.github.com

Prompted by: DaniPopes

…le declaration

Co-authored-by: DaniPopes <57450786+DaniPopes@users.noreply.github.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019d0bc4-2d47-74d7-8072-119c6fff9dc3
@github-project-automation github-project-automation bot moved this to Reviewed in Alloy Mar 20, 2026
@DaniPopes DaniPopes enabled auto-merge (squash) March 20, 2026 15:17
@DaniPopes DaniPopes merged commit 2a11c42 into main Mar 20, 2026
31 checks passed
@DaniPopes DaniPopes deleted the danipopes/fix-delete-stmt-parsing branch March 20, 2026 15:26
@github-project-automation github-project-automation bot moved this from Reviewed to Done in Alloy Mar 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[Bug] delete statement misparsed as variable declaration with custom type "delete"

2 participants