Repository navigation
Parse Yaml compact nested sequences and multiline quoted flow scalars - #10279
Closed
effect-bot wants to merge 5 commits into
Closed
effect-bot wants to merge 5 commits into
effect-bot wants to merge 5 commits into
Conversation
🦋 Changeset detectedLatest commit: d62543e The changes in this PR will be included in the next version bump. This PR includes changesets to release 33 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
Bundle Size AnalysisGenerated from PR build output; treat the content below as untrusted.
|
This was referenced Nov 2, 2026
tim-smart
force-pushed
the
v4/next-minor
branch
from
November 3, 2026 20:54
2e13c53 to
5f5a4b3
Compare
effect-bot
force-pushed
the
v4/next-minor
branch
7 times, most recently
from
November 3, 2026 22:52
97a1ee1 to
10d44ad
Compare
effect-bot
force-pushed
the
agent/nelson-effect-bot/eff-3232-stage4-grammar
branch
from
November 3, 2026 23:14
4d196cf to
aa5ba2d
Compare
effect-bot
force-pushed
the
v4/next-minor
branch
from
November 3, 2026 23:39
2650b53 to
0a68f11
Compare
effect-bot
force-pushed
the
agent/nelson-effect-bot/eff-3232-stage4-grammar
branch
from
November 3, 2026 23:39
aa5ba2d to
c63e47d
Compare
effect-bot
changed the base branch from
v4/next-minor
to
agent/nelson-effect-bot/eff-3232-stage3-hardening
November 3, 2026 23:40
effect-bot
changed the base branch from
agent/nelson-effect-bot/eff-3232-stage3-hardening
to
v4/next-minor
November 3, 2026 23:40
This was referenced Nov 3, 2026
Closed
effect-bot
changed the base branch from
v4/next-minor
to
agent/nelson-effect-bot/eff-3232-stage3-hardening
November 3, 2026 23:42
A sequence entry may start a nested sequence on its own line, quoted scalars inside flow collections may span lines, and a block sequence on a mapping key's line fails instead of being read as text.
Avoids quadratic growth from appending to and indexing one string, keeps an escaped trailing space before a quoted flow line break, and applies quoted-content indentation rules while a flow quote is open.
Reuse closingQuote and endsWithEscape to scan each line of a quoted flow scalar instead of a second hand-written quote scanner, and decide a sequence entry's shape once instead of testing it three times.
effect-bot
force-pushed
the
agent/nelson-effect-bot/eff-3232-stage4-grammar
branch
from
November 3, 2026 23:43
c63e47d to
d62543e
Compare
effect-bot
force-pushed
the
agent/nelson-effect-bot/eff-3232-stage3-hardening
branch
from
November 3, 2026 23:43
5608c22 to
a8cf572
Compare
Contributor
Author
|
Superseded by #10287, which now holds the rest of the YAML expansion as one PR against |
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.
Stage 4 of the YAML expansion adds two pieces of YAML grammar that
Yaml.parseused to reject.Behavior
Compact nested sequences (YAML 1.2.2 §8.2.1). A sequence entry can start another sequence on the same line (
- - 1), nested to any depth up to the existing 1000-level limit. The nested sequence is indented to its first dash, so- - 1also works. An entry inside it can itself be a compact mapping, an anchor or alias, a flow collection or a block scalar. A dash on a more indented continuation line is still part of a plain scalar (- - 1followed by- 2gives[["1 - 2"]]), and a less indented entry still fails.Multiline quoted scalars in flow collections (YAML 1.2.2 §7.3). Single- and double-quoted items and keys inside
[...]and{...}can span lines. They fold the same way as quoted block values:#inside the quotes is contentA continuation at the parent's indentation, or across a document marker, still fails. The scan continues from where it stopped, so long scalars stay linear: 16,000 continuation lines take about 44 ms.
key: - valuefails. A block sequence can't start on the same line as a mapping key or anchor. It used to be read as the string"- value".yamlrejects it too.Docs
.changeset/yaml-compact-sequences.mdisminor.Validation
Yaml.test.ts: 246 of 246. That includes the 22 stage 4 tests, YAML 1.2.2 example 8.15, and the former "rejects compact nested sequences" table, now changed to expect a parse.YAML, CLI, Skills, ai-codegen and openapi-generator tests: 890 passed, 3 skipped.
I compared 19 extra edge cases with
yaml2.9.1. They covered:All match, except the tab case below.
1000 nested compact sequences parse; 1001 and 2000 fail with the depth error.
pnpm lint,pnpm jsdocs --checkand theYaml.tsdoctests pass.pnpm checkreports one error, theapiStabilityLeakincluster/ShardingRegistrationEvent.ts, which also occurs onv4/next-minor.Known difference, not changed here: a tab after a sequence dash (
-\t1,- -\t1) is still read as plain text, whileyamltreats the tab as separation. This was already the case at the top level before this stage.Stack
These PRs form one stack. Each targets the PR before it, so its diff shows only its own stage. Merge them in this order:
Yaml.parseAllandResultfromYaml.parse(merged)v4/next-minorYaml.stringifyandYaml.stringifyAll, based on Resolve Yaml core schema tags #10285Yaml.parse, based on Add Yaml.stringify and Yaml.stringifyAll #10272After a PR in the stack is squash-merged, the next one has to be rebased onto the squash commit and retargeted to
v4/next-minorbefore it can merge.Closes EFF-3232