FA-80599 / Bidirectional text layout / Member archive
Bracket pair identification: stack search direction · case 04
A closer pairs with the outermost matching opener.
Case contract
Input [text, classes, stack limit]. Only characters of class ON take part. Openers ( [ { are pushed; on overflow of the stack limit stop and keep pairs found so far. A closer searches the stack from the top for its opener; if found it pairs and discards that entry and everything above; otherwise it is ignored. Return pairs sorted by opener.
Why this case matters
Mixed right-to-left and left-to-right text must resolve levels and visual order exactly, or words, numbers and carets land in the wrong place.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: stack search direction | [[1, 9]] | [[6, 9]] | Failed |
MEMBER ARCHIVE
The complete case is available to members.
This record includes three runnable implementations, regression fixtures, execution results, and source hashes.
Member access is invitation-based. Sign in with your invited account to inspect the sources.
Sign in to the archive ↗