Repository navigation
Conversation
Co-authored-by: WillBooster (Codex) <agent@willbooster.com>
Co-authored-by: WillBooster (Codex) <agent@willbooster.com>
Co-authored-by: WillBooster (Codex) <agent@willbooster.com>
Preserve explicit continuation context and exact declaration ranges while rejecting intervening unjoined lines. Group ignored endings and query physical columns only when line-start classification needs them. Co-authored-by: WillBooster (Codex) <agent@willbooster.com>
Keep column-zero continuations inside their suites while preserving separate visible join tokens and rejecting later unjoined newlines. Co-authored-by: WillBooster (Codex) <agent@willbooster.com>
Inspect indentation through the full logical line while retaining whether its continuation precedes an unjoined physical ending. Preserve leading suite ownership and exact terminal declaration and continuation ranges. Co-authored-by: WillBooster (Codex) <agent@willbooster.com>
Retain malformed header errors while exposing independent following statements. Emit queued dedents only where the grammar accepts them and retire obsolete scanner indentation after recovery leaves a suite. Co-authored-by: WillBooster (Codex) <agent@willbooster.com>
Keep physical line context synchronized when comments follow joins across mixed line endings, preserving visible continuation ranges and suites. Co-authored-by: WillBooster (Codex) <agent@willbooster.com>
Recognize bare CR in string escape sequences so explicit string joins keep the same syntax nodes as LF and CRLF. Exercise ordinary, bytes, formatted, triple-quoted, and raw strings through the public parser. Co-authored-by: WillBooster (Codex) <agent@willbooster.com>
Skip physical-line classification where bracket or comment context already determines ignored endings. Keep layout lookahead zero-width so declaration endpoints remain stable, and bound public input work for bracketed LF and CRLF comments. Remove the obsolete claim that recovery emits unexpected dedents. Co-authored-by: WillBooster (Codex) <agent@willbooster.com>
Stop non-triple string content at either line-ending character, including before any content is consumed. Classify format text using the enclosing delimiter so unescaped single-line endings fail while escaped joins and triple-format ranges remain valid. Cover literal prefixes, quote styles, format escapes, following calls, and public incremental edit and undo. Co-authored-by: WillBooster (Codex) <agent@willbooster.com>
Keep escaped quote and slash handling exclusive with escaped physical endings. An already escaped slash or quote cannot also escape the following newline. Cover raw slash parity, quote escapes, multiline triples, content ranges, and following calls across LF, CRLF, and CR. Co-authored-by: WillBooster (Codex) <agent@willbooster.com>
Recognize the grammar's explicit FEFF, word-joiner, and zero-width-space extras during indentation, ignored-ending, and continuation lookahead. Count their input columns without adding indentation so blank and comment-only lines preserve surrounding suites. Cover exact token and declaration ranges, literal content, unjoined endings, and public insertion and undo. Co-authored-by: WillBooster (Codex) <agent@willbooster.com>
Merge the latest runtime 13 parser refresh and regenerate with the published 14.0.0 generator/runtime contract. Commit the stronger CR input read regression without changing its bound now that the released core cache repairs make every source pass. Co-authored-by: WillBooster (Codex) <agent@willbooster.com>
Co-authored-by: WillBooster (Codex) <agent@willbooster.com>
Make continuation tokens scanner-owned so the internal lexer cannot bypass the EOF check. Reject a whole line ending without a following physical line, preserving valid joined blank and comment lines. Correct the single invalid terminal-join corpus expectation to an error; keep every input byte and valid continuation range unchanged. Co-authored-by: WillBooster (Codex) <agent@willbooster.com>
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.
Why
The grammar silently accepts physical newlines that CPython rejects, including
def function(value)\n:\n return valueandvalue = 1 +\n 2. Global whitespace consumed those newlines before they could terminate or invalidate a logical line. This addressestree-sitter/tree-sitter-python#178.Requirements
WillBooster/tree-sitter#255make the unchanged seven-source 16x public bound pass for comments, brackets, statements, Unicode, BOM, and joins. Released 12.0.2 still requests 421,018 characters against a 384,128 bound for CR statements; actual14 scales 1k/2k/4k/8k statements to 11,790/23,838/47,932/96,120 characters. Absolute-position serialization was rejected because it increased prefix-edit work and depended on a separately defective getter. Keep the publication block if expanded regressions fail.Customer Summary
Unjoined newlines before a header's colon or inside an unbracketed expression produce syntax errors. Valid continuations, multiline strings, comments, indentation, and following statements retain their structure and source ranges. An explicit join requires a following physical line. Consumers must use the WillBooster runtime 14.x.
Technical Summary
The grammar restricts horizontal whitespace and gives the scanner ownership of physical endings. Logical boundaries and queued dedents remain zero-width; a separate hidden extra consumes the physical ending so declarations exclude their trailing newline. Serialized join context preserves visible continuation tokens, suite ownership, and terminal declaration endpoints. Recovery emits logical boundaries only after real physical endings and retires indentation levels that the grammar cannot consume. Comment handling stops at either ending character and avoids unnecessary line-start classification inside brackets or after a known comment-only line.
The continuation token is scanner-owned only: an internal token previously bypassed scanner rejection. A complete LF/CRLF/CR ending followed immediately by EOF is rejected, while a following blank/comment/horizontal line remains valid.
Non-triple strings and format text reject unescaped physical endings, including empty content. Raw quote/slash escapes and escaped endings are exclusive; valid odd-slash joins and triple-format captures retain their source ranges. Explicit FEFF/U+2060/U+200B extras remain tolerant horizontal trivia with one input-column unit and zero indentation width.
Runtime dependencies, Rust documentation, and README usage require the actual published 14.0.0 release. Canonical ABI10 parser tables use its matching published CLI, the 210 unchanged corpus input bodies, and 12 tracked profile inputs. This includes the core column-cache repairs without storing absolute source positions in the Python scanner.
Testing
bun run build/ci: matching published 14.0.0 CLI, optimization z, canonical corpus/source profile; passes.CARGO_BUILD_JOBS=1 cargo test --locked --lib: actual published crate loads the generated grammar; passes.bun run verify: passes; remaining scanner code-gauge findings are explained below.reparses the corpus consistentlyfuzz test; its full-suite CI execution remains enabled. No corpus expectation or existing source-range assertion was weakened.Notes
The scanner still reports cognitive complexity 246, function NCSS 288, and file NCSS 579. Reaching those thresholds would require restructuring unrelated string scanning and splitting the scanner translation unit; moving branches between helpers would only relocate complexity. No gauge exclusion was added.
Zero-width boundaries and separate ending consumption preserve the existing declaration endpoint contract at the measured residual parsing cost above; no exact throughput parity is claimed. The initial cache integration was blocked until the expanded public regression passed against an actual published dependency. The retained 12.0.2 snapshot documents its residual keyword-lookahead replay failure; 14.0.0 is verified with the unchanged stronger bound and edit/range controls.
Blank/comment-only lines after explicit joins, bare-CR continuations, LF/CRLF single-line formats, and twelve raw slash-parity cases already failed the intended contract at the original base. Their independent repairs complete the recorded newline requirement and are not counted as branch-introduced review defects. Bare-CR string acceptance was introduced by the branch. Empty-content unterminated strings retain the base LF recovery shape: a following call survives outside string content but can belong to the malformed assignment during recovery.
FEFF/U+2060/U+200B are explicitly declared original grammar extras. Retaining them consistently is an intentional tolerant syntax policy, not a claim of CPython acceptance. Since the base can already detach suite calls after extra-prefixed indentation, normalized syntax and explicit suite ownership govern those controls.
The Function definitions corpus input ends in a terminal explicit join that CPython rejects. Its final expected line_continuation is corrected to ERROR/UNEXPECTED backslash, preserving every input byte and all valid trees. The whole legacy fixture also contains a Python 2 tuple parameter that CPython 3 rejects earlier; an isolated terminal function and the independent EOF matrix establish the EOF error separately. LF/CRLF EOF acceptance pre-exists, while bare-CR EOF acceptance is introduced by this branch; the unified repair follows the recorded newline contract.