Skip to content

[Yaml] Wrong line number when comments are inserted in the middle of a block #15437

Closed
@nicolas-grekas

Description

@nicolas-grekas

This yaml:

foo:
    -
        # bar
        bar: "123",

triggers:
Unexpected characters near "," at line 3 (near "bar: "123",").

The line number is wrong (it should be 4).
This is because Parser::getNextEmbedBlock() removes the comment line before the parse error occurs.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions