FA-80527 / Bidirectional text layout / Member archive
Explicit embedding stack: next even level · case 02
LRE inside an RTL embedding skips a level.
Case contract
Input [classes, paragraph level, max depth]. RLE/RLO push the next odd level, LRE/LRO the next even level (RLO/LRO set an R/L override, RLE/LRE clear it) if the level <= max depth and no overflow is pending, else count an overflow. PDF first cancels an overflow, else pops if above the base. Codes get level "x" and class BN; other characters take the top level and the override class if any. Return [levels, classes].
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: next even level | [[1, "x", "x", "x", "x", 5, 5, "x", 5, 5, "x", 5], ["WS", "BN", "BN", "BN", "BN", "R", "R", "BN", "R", "R", "BN", "R"]] | [[1, "x", "x", "x", "x", 4, 4, "x", 4, 4, "x", 4], ["WS", "BN", "BN", "BN", "BN", "L", "L", "BN", "L", "L", "BN", "L"]] | 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 ↗