Repository navigation
fix(provider): count directive-malformation and enum-increment as syntaxError - #588
Merged
Merged
Conversation
…taxError Second review follow-up to #578: script-invalid (unquoted #!postCompileHook path, malformed __script__ body in #!define) is a verdict on the directive line's own text, and enum-increment only needs the same-block predecessor — both document-local, matching the list's directive-malformation siblings (directive-invalid, define-invalid, macro-invalid). enum-type-without-member stays deferred: enum_visible consults the project-merged table, so a bare name may resolve through a sibling declaration. New normative-rules cases cover all three emit sites and fail without the entries.
Teakowa
approved these changes
Oct 18, 2026
Teakowa
left a comment
Contributor
There was a problem hiding this comment.
LGTM — emit-site audit holds: all three script-invalid sites judge the directive line's own text, enum-increment needs only the same-block predecessor. enum-type-without-member correctly stays deferred (enum_visible reads the project-merged table). New cases verified failing without the entries.
This was referenced Oct 18, 2026
Merged
2 tasks done
e54-bot
added a commit
that referenced
this pull request
Oct 19, 2026
…#593) The DOCUMENT_SYNTAX_CODES allowlist shipped incomplete twice (#587, #588): every omission silently returned valid:true for malformed documents. Adds EXCLUDED_CODES plus NON_DIAGNOSTIC_LITERALS and a unit test scanning all kebab-case literals in ../opy-rs/src — every diagnostic code must appear in exactly one list, so a new code fails until a reviewer classifies it. The deferred classes are documented on the list itself. Fixes #591 Co-authored-by: Teakowa <git@teakowa.dev>
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
Second review follow-up to #578 (after #587). Audited
script-invalidand theenum-*codes against their emit sites:script-invalidis document-local — all three emit sites judge the directive line's own text:#!postCompileHookwithout a quoted path (preprocess/directives.rs:105) and a malformed__script__(...)body in#!define(preprocess/macros.rs:141,150). The verdict is about the line's shape, not the script file — matching sibling directive-malformation codes already listed (directive-invalid,define-invalid,macro-invalid). Before this change,#!postCompileHook junkreturned{"valid": true}where pre-fix(provider): scope lpp/validateEdits syntaxError to document-local malformation #578 returnedsyntaxError.enum-incrementis document-local —EnumCounter::Otherkeys only on the previous initializer's literal shape inside the same single-fileenumblock (lower/declarations.rs:246).enum-type-without-memberstays deferred —enum_visibleconsults the project-merged declaration table, so a bare name may resolve through a sibling declaration; deferral is now documented explicitly in the allowlist comment.Test plan
validate_edits_applies_normative_rulescases (unquotedpostCompileHook, malformed__script__, non-numeric enum predecessor) — verified failing without the allowlist entriescargo test -p opy-provider --test lpp— 69/69 pass (run locally)cargo fmt --all -- --check,cargo clippy -p opy-provider --all-targets -- -D warnings