Repository navigation
chore: remove dead parse_comptime_decl method from parser - #28
Merged
Merged
Conversation
`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.
🔍 Hypatia Security ScanFindings: 44 issues detected
View findings[
{
"reason": "codeql.yml lists `language: javascript-typescript` but the repo has no source files in any CodeQL-scannable language. The analyze job will exit 'no source files' on every run. Switch the matrix to `actions` (which scans workflow files — every repo has those).",
"type": "codeql_language_matrix_mismatch",
"file": "codeql.yml",
"action": "switch_codeql_matrix_to_actions",
"rule_module": "workflow_audit",
"severity": "high"
},
{
"reason": "Admitted leaves proof hole (1 occurrences, CWE-704)",
"type": "admitted",
"file": "/home/runner/work/my-lang/my-lang/proofs/verification/coq/Typing.v",
"action": "flag",
"rule_module": "code_safety",
"severity": "critical"
},
{
"reason": "Docker reference in Nickel config -- RSR requires Podman/Containerfile (1 occurrences, CWE-1104)",
"type": "ncl_docker_not_podman",
"file": "/home/runner/work/my-lang/my-lang/.machine_readable/svc/k9/my-lang-metadata.k9.ncl",
"action": "flag",
"rule_module": "code_safety",
"severity": "medium"
},
{
"reason": "unwrap() without prior check -- DoS via panic (2 occurrences, CWE-754)",
"type": "unwrap_without_check",
"file": "/home/runner/work/my-lang/my-lang/src/proptest.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "high"
},
{
"reason": "panic! macro causes unrecoverable crash (1 occurrences, CWE-754)",
"type": "panic_macro",
"file": "/home/runner/work/my-lang/my-lang/src/proptest.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "high"
},
{
"reason": "unwrap_or(0) with dangerous default (1 occurrences, CWE-754)",
"type": "unwrap_dangerous_default",
"file": "/home/runner/work/my-lang/my-lang/playground/hives/me/crates/parser/src/lib.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "critical"
},
{
"reason": "expect() in hot path (80 occurrences, CWE-754)",
"type": "expect_in_hot_path",
"file": "/home/runner/work/my-lang/my-lang/playground/hives/me/crates/parser/src/lib.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "medium"
},
{
"reason": "unwrap() without prior check -- DoS via panic (2 occurrences, CWE-754)",
"type": "unwrap_without_check",
"file": "/home/runner/work/my-lang/my-lang/dialects/solo/compiler/src/lexer.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "high"
},
{
"reason": "unwrap() without prior check -- DoS via panic (1 occurrences, CWE-754)",
"type": "unwrap_without_check",
"file": "/home/runner/work/my-lang/my-lang/lib/common/string.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "high"
},
{
"reason": "unwrap() without prior check -- DoS via panic (13 occurrences, CWE-754)",
"type": "unwrap_without_check",
"file": "/home/runner/work/my-lang/my-lang/lib/common/concurrency.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "high"
}
]Powered by Hypatia Neurosymbolic CI/CD Intelligence |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Remove the unused
parse_comptime_declhelper fromcrates/my-lang/src/parser.rs. It was never called -- thecomptimetop-level declaration is handled inline inparse_top_level(theSome(TokenKind::Comptime)arm reads thecomptimekeyword, optionally branches toparse_orchestrate_decl, and otherwise builds aComptimeDecldirectly from the block).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.
Test plan
cargo test -p my-lang --lib parser::-- 32/32 pass (same count as before; the method had no associated tests).cargo clippy -p my-lang --lib --no-deps-- the loneparse_comptime_decl is never usedwarning at parser.rs:825 is gone.This is the deferred one-liner from #26.