Skip to content

Commit 6eff13f

Browse files
chore: remove dead parse_comptime_decl method from parser (#28)
`parse_comptime_decl` was never called -- the `comptime` top-level declaration is handled inline in `parse_top_level` (the `Some(TokenKind::Comptime)` arm reads `comptime`, optionally branches to `parse_orchestrate_decl`, and otherwise builds a `ComptimeDecl` directly from the block). The separate helper was a leftover from an earlier factoring. Identified during the #22 dead-code review (PR4 / #26) but deferred at the time to avoid merge-conflict risk with the depth-guard PR #21 also modifying parser.rs. With #21 merged this is a one-method delete. Tests: `cargo test -p my-lang --lib parser::` -- 32/32 pass (same count as before; the method had no associated tests). Clippy: the lone `parse_comptime_decl is never used` warning at parser.rs:825 is now gone.
1 parent defa5df commit 6eff13f

1 file changed

Lines changed: 0 additions & 12 deletions

File tree

crates/my-lang/src/parser.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -818,18 +818,6 @@ impl Parser {
818818
Ok(items)
819819
}
820820

821-
// ============================================
822-
// Comptime Declaration
823-
// ============================================
824-
825-
fn parse_comptime_decl(&mut self) -> ParseResult<ComptimeDecl> {
826-
let start = self.current_span();
827-
self.expect(TokenKind::Comptime)?;
828-
let block = self.parse_block()?;
829-
let span = self.span_from(start);
830-
Ok(ComptimeDecl { block, span })
831-
}
832-
833821
// ============================================
834822
// Contract
835823
// ============================================

0 commit comments

Comments
 (0)