Skip to content

Trailing scalar in block mapping generates no error at end of document #819

Description

@mberk

Example YAML document:

---
foo: bar
not-a-key

This is incorrectly parsed successfully with not-a-key treated as a key in the map with a null value.

If there is anything after the scalar, e.g.:

---
foo: bar
not-a-key
# A comment

Then a ParserException is thrown:

what(): yaml-cpp: error at line 3, column 1: end of map not found

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions