Skip to content

Comments

Feat/fix faulty string#1406

Merged
jbeder merged 4 commits intojbeder:masterfrom
SGSSGene:feat/fix_faulty_string
Feb 18, 2026
Merged

Feat/fix faulty string#1406
jbeder merged 4 commits intojbeder:masterfrom
SGSSGene:feat/fix_faulty_string

Conversation

@SGSSGene
Copy link
Contributor

@SGSSGene SGSSGene commented Feb 18, 2026

Fixes skipping of empty documents and Issue #1405.

First Issue

A stream of multiple yaml documents can be separated by --- indicating starts of a new document and/or ... indicating end of a document.
So the following stream should produce 3 empty documents.

...
...
...

Currently yaml-cpp skips over empty documents at the end, so it falsely only produces a single empty document.

Second Issue

The case of [foo]_bar produces multiple documents. The first one just containing the sequence [foo]. The second one containing the scalar _bar.
This happens because it is missing to check if after a document are any unexpected tokens left in the stream.

Changes of this PR

This PR fixes both issue, the commits do the following:
1: add tests to check correct parsing of empty documents (fails)
2: fixes skipping of empty documents
3: add tests for [foo]_bar (fails)
4: fixes the newly added [foo]_bar case.

@jbeder jbeder merged commit 97d150e into jbeder:master Feb 18, 2026
31 checks passed
@SGSSGene SGSSGene deleted the feat/fix_faulty_string branch February 18, 2026 20:47
@SGSSGene
Copy link
Contributor Author

@jbeder you are super fast! thank you!

@romainreignier
Copy link

Wow! Thay was fast! Thanks guys!
Any chance to get a review on #1377 ?

This was referenced Feb 19, 2026
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.

3 participants