Skip to content

fix: expose complete Java text block escapes - #40

Merged
exKAZUu merged 1 commit into
mainfrom
fix/text-block-escape-nodes
Oct 22, 2026
Merged

exKAZUu merged 1 commit into
mainfrom
fix/text-block-escape-nodes

Conversation

@exKAZUu

@exKAZUu exKAZUu commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

Why

Text-block line continuations and zero-octal escapes can disappear from the public tree, so the shipped escape query cannot highlight them. Escaped quotes after raw quote fragments are also hidden. Reusing the public escape token alone still splits a CRLF continuation after CR.

Requirements

  • required: Improve the forked grammar repositories, excluding CSS and Markdown, ignoring backward compatibility; review fork issues and major upstream issues, PRs and recent commits, and resolve eligible items.
  • required: Prevent duplicate PRs, and create a dedicated PR from the latest main for each identified issue or upstream item that warrants resolution.
  • required: Run review-booster and complete-pr concurrently, then release the changes; continue until all eligible upstream items are processed.
  • required: Consumers must be able to query complete text-block escape nodes and source spans through the shipped escape-highlighting query.
  • chosen: Address text-block escape visibility as one dedicated upstream origin, reusing the public escape token rather than retaining a competing hidden fallback.
  • chosen: Treat CRLF continuations as one escape and stop quoted fragments before escaped quotes; JDK 27 accepts these fixtures and the root-only visibility patch misses their complete query spans.
  • chosen: Keep the public node schema and retain measured ordinary strings and unrelated declarations; use real parser/query regression checks, compiler fixtures and incremental edits to validate the boundary behavior.

Customer Summary

Text-block continuations, zero-octal escapes and escaped quotes are visible as complete escape_sequence nodes and receive the shipped escape highlight, including CRLF continuations.

Technical Summary

grammar.js uses escape_sequence directly in text blocks, recognizes CRLF as one escape token and keeps escaped quotes out of quoted fragments. The public node schema is unchanged. The existing literal corpus gains its missing escape node; three API regressions check complete nodes, highlight spans and following declarations across LF, CRLF and CR.

Testing

  • Official JDK 27 compiled four fixtures covering text-block escapes, all three line terminators and quoted fragments without diagnostics.
  • Canonical generation, all 165 native/Wasm corpus cases and 72 focused tests across 14 files passed. Four native fixtures expose 24 escape nodes; public Web API checks verify their exact ranges, points and highlights plus 11 full-metadata/query incremental edit/undo states.
  • Full trees and both shipped queries for 35 existing programs, six CST/query/edit controls and the public schema match published 9.0.1. Among 240 whitespace controls, 222 full trees remain exact and 18 change only in the intended LF-continuation visibility cases.
  • bun run verify passed with zero code-gauge violations. Rust unit and documentation tests passed. All 165 corpus cases passed 100 fuzz iterations with ten edits, explicitly using seed 1.
  • All PR CI checks passed, including the full suite, native platform jobs, Rust and fuzzing.

Notes

The additional CRLF and quoted-fragment changes cover compiler-valid escape spans that the upstream visibility patch alone misses. Verification is scoped to the recorded cases rather than a claim of universal grammar equivalence.

Co-authored-by: WillBooster (Codex CLI) <agent@willbooster.com>
@exKAZUu exKAZUu self-assigned this Oct 22, 2026
@exKAZUu
exKAZUu merged commit 0ece3ce into main Oct 22, 2026
10 checks passed
@exKAZUu
exKAZUu deleted the fix/text-block-escape-nodes branch October 22, 2026 01:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant