Repository navigation
fix(frontend): resolve 0.7.1 parser recovery, attribution, and completion gaps - #2
Merged
Merged
Conversation
…ge 1-6 record - Map the status of the 30 parser, recovery, and completion issues against the current baseline - Describe root causes, target behavior, and missing test coverage for each open gap - Define phased remediation steps, validation gates, and open design decisions - Archive the completed stage 1-6 plan and its execution history as a historical reference
- Add `ParseOutcome.EnclosedDamage` so closed containers retain child damage while Lua-key validation and Pratt folding stay aligned - Propagate lexical and structural header damage through Pratt operators, specialized prefixes, and lambda signatures without cascading secondary diagnostics - Return `ParseOutcome<ParsedType>` from type parsing across all callers, drop `diagBefore` checks, and add `type.argument` owner fallback for `as`/`is` - Synchronize `for` headers to `in` after any non-`Ok` type outcome within header boundaries, including explicit line continuations - Sync recovery design docs and expand recovery, invariant, and serde regression tests
- Pair local openers by kind during recovery sync while yielding ancestor closers and unshielded outer commas - Align bracket oracle literal boundaries with the tokenizer and propagate non-closer line-indent minima in O(1) - Balance poisoned bracket chains by kind with single-layer replacement, safe inner-frame resume, and recovery-window colon guards - Lock generic dictionary comma precedence (3A) and add four-tier linear scaling and recovery/completion regressions - Record R2 completion status and validation summary in the 0.7.1 fix plan
…k boundaries - Attribute orphan closers by position across statement tails, suites, class bodies, and ownerless top level while respecting semicolons and ancestor ownership - Link discarded duplicate-parameter lambda defaults, class-body fragments, and suite circuit breakers (4B-A) to surviving owners and enforce full position-aware I5 checks - Emit a single primary diagnostic per rejected property accessor while isolating indented/inline bodies, comma handoff, and lambdaEnded state - Use the dictionary key physical end line for same-line value recovery and hand off trusted cross-line return arrows only on damaged signatures - Sync R3 status and recovery contract docs
…edup, and bare lambdas - Keep pending target annotations intact across standalone directives while preserving flat AST source order, script-root eligibility, and O(1) scoped buffer isolation - Accept consecutive nested class body-head and inline semicolon-separated extends with first-wins precedence and CLASS_DUPLICATE_EXTENDS on class.extends - Suppress derivative ASSIGNMENT_INVALID_TARGET on RecoveredInfixExpression targets while preserving surface lvalue and call guards - Reject parenthesized and nested bare lambda statements uniformly via LAMBDA_BARE_STATEMENT on the enclosing ExpressionStatement - Sync R4 status and metered linear-work validation summary in the 0.7.1 fix plan
… gates - Add package-private read-only step counters without changing production behavior or public APIs - Expand lexer, parser, strict, recovery, real-AST serde/walker, and dual-entry completion matrices - Verify UTF-8 half-open ranges, I5 same-parse owner/facet attribution, and six renamed tests - Enforce four-tier (256-2048) linear bounds across lexing, recovery, completion, and fallback chains
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
Complete R1–R5 of the GDParser 0.7.1 gap-fix plan. The plan inventories 30 tracked GDScript issues, finalizes the recovery decisions, and distinguishes fixes from behavior already present in the baseline that now has stronger tests. The implementation aligns syntax checks with upstream Godot while keeping the Java parser's ability to preserve a usable AST for malformed input.
inafter a damagedforiterator type when the header boundary permits it.BracketBalanceOraclescans once per input stream using tokenizer-aligned literal boundaries. Kind-indexed poisoned-bracket unwinding uses O(1) bookkeeping and replaces at most one unmatched layer at a time without raising the depth budget. A local lambda-header state machine and boundedmatchcolon shielding keep inner syntax from consuming the outer branch boundary. UnpairedDictionarytype commas still yield to the outer owner.->only after a damaged signature.PendingAnnotationwork with constant-time scope isolation. Give the first nested-classextendsprecedence, even when its target is malformed. Suppress derivative invalid-target errors forRecoveredInfixExpressionwithout relaxing lvalue or direct-call checks. Reject bare lambdas used as statements, including parenthesized and multiply grouped forms, while preserving valid lambda values, arguments, and.call()uses.Behavior and contract changes
ParseOutcomenow has five states:Ok,Missing,Failed,Damaged, andEnclosedDamage.EnclosedDamagemarks a structurally complete value with damaged children;Damagedmarks unenclosed damage. RemoveisOk()andvalueOrNull(). Type parsing now returnsParseOutcome<ParsedType>instead of inferring success from diagnostic counts.DiagnosticCodesandRecoveryLinkallow recovered cast and type-test diagnostics to bind totype.argument. Repeated nested-class inheritance uses the dedicatedparse.class.duplicate_extendsdiagnostic onclass.extends.UNEXPECTED_CLOSERretains its code and binds by position tostatement.trailing,suite.body, orclass.body; ancestor closers keep their existing owners, and truly ownerless top-level closers remain unlinked.STATEMENT_TOO_MANY_ERRORSbinds tosuite.bodywhen a suite host survives, including a lambda. Missing-expression slot diagnostics in discarded lambda defaults can fall back to the survivingfunction.signatureorsignal.parameterwhere registered. The position-aware I5 gate checks that every error has a registered code and that links point to reachable owners and valid facets in the same parse. All known baseline I5 violations are covered and eliminated; truly ownerless errors and independent lexical errors remain allowed.Affected packages
dev.superice.gdparser.frontend.gdscript: parser, tokenizer, completion, recovery, diagnostics, and tests.dev.superice.gdparser.frontend.astanddev.superice.gdparser.frontend.serialize: traversal and serialization tests.doc/: gap inventory, architecture decisions, recovery contracts, and verification records.Validation
./gradlew clean build --no-daemon --info --console=plainatb99cb5e: 2,072 tests across 26 classes passed, with 0 failures, 0 errors, and 0 skipped.test --tests, via the local targeted-test wrapper): R1 505 tests across 5 classes; R2 1,628 across 5; R3 1,684 across 7; R4 639 across 6; R5 1,957 across 16, followed by 1,452 across 4 after review. All passed without failures, errors, or skips.