Make std binding policy checks recognize valid whitespace and multiline declarations
- Dominant language
- Rust
- Stars
- 53
- Forks
- 16
- Avg merge
- 4h 22m
- Merged PRs (30d)
- 46
Description
`check_std_policy.sh` searches for literal-adjacent forms such as `extern(c` and `import("std::libc::`. Valid spacing between these tokens (for example `extern ( c, "name" )` or a spaced import) avoids the searches. The frontend parses tokens with whitespace skipping, so formatting can change whether the policy checker sees the same declaration.
The check should follow accepted source layouts without confusing commented-out text with an active binding.
Code evidence:
- [tools/check_std_policy.sh:12](https://github.com/wavefnd/Wave/blob/ea74c2dafc31da876e5561f2d176ba719f5a0458/tools/check_std_policy.sh#L12)
- [tools/check_std_policy.sh:23](https://github.com/wavefnd/Wave/blob/ea74c2dafc31da876e5561f2d176ba719f5a0458/tools/check_std_policy.sh#L23)
- [front/parser/src/parser/decl.rs:272](https://github.com/wavefnd/Wave/blob/ea74c2dafc31da876e5561f2d176ba719f5a0458/front/parser/src/parser/decl.rs#L272)
Acceptance:
- [ ] Recognize the relevant declarations across accepted spaces/newlines/comments between tokens.
- [ ] Add isolated fixtures for compact, spaced and multiline bindings/imports and for commented-out lookalikes.
- [ ] Apply the existing allowed-provider rules consistently to equivalent source forms.
- [ ] Do not solve the problem by restricting valid Wave formatting or adding a frontend parser dependency.
Audit status: static source inspection against canonical master `ea74c2dafc31da876e5561f2d176ba719f5a0458` on 2026-09-10. No compiler build, test execution, implementation change or local reproduction was performed for this report. The examples describe the source-derived behavior to verify when implementing the fix.
Contributor guide
Research direction
Start by reading tools/check_std_policy.sh at lines 12 and 23, then compare its token matching with whitespace handling in front/parser/src/parser/decl.rs around line 272. Add isolated fixtures for compact, spaced, multiline, and commented-out bindings, and run the existing policy-check tests or script. Done means equivalent valid declarations follow the same provider rules without matching commented text.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust, shell
- Domain
- compilers, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100