SIGN IN SIGN UP
oven-sh / bun UNCLAIMED

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one

0 0 150 Rust

yaml: clear remaining 3 non-cyclic `test.todo` entries (BOM strip, 2-anchor e-node key, flow cmi gap) (#31569)

## What

Clears the last three `test.todo` entries that are not cyclic-anchor
related (those four remain deferred).

| Input | Before | After | Spec |
|---|---|---|---|
| `---\na: 1` | error / spurious BOM-only first doc | `{a:1}` | [206]
`l-document-prefix ::= c-byte-order-mark? l-comment*` |
| `&outer\n&inner : x` | `MultipleAnchors` | `{null:"x"}` | [200] outer
anchors collection, [193] inner anchors key (same line as `:`) |
| `{a: &x\n b: c}` | `{a:{b:"c"}}` (over-accept) | error | [147]
flow-map value is `ns-flow-node`, not a pair |

## How

- New `Encoding::bom_len()` (3 for UTF-8 `EF BB BF`, 1 for UTF-16
`FEFF`, 0 for Latin-1). `Parser::init` starts `pos`/`line_start_pos`
past it.
- `MappingValue` arm clears `has_mapping_anchor` after
`implicit_key_anchors` consumed it (was reaching the post-loop guard).
`set_anchor` errors instead of silently overwriting on a 3rd anchor.
- `parse_node` Scalar arm returns the bare scalar in `FlowIn &&
!flow_pair_allowed` instead of falling through to `parse_block_mapping`;
closes the multiline-property gap left by the cmi mechanism.

## Tests

7 → **4** todos (cyclic anchors only). 2032 pass / 0 fail / 402/402
yaml-test-suite / 1015/1015 4-parser consensus.

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
D
Dylan Conway committed
7069b3092971b625463600abc5955e85f601ade1
Parent: 3a79bd7
Committed by GitHub <noreply@github.com> on 5/29/2026, 10:27:06 PM