8000 [Yaml] Anchors are not parsed correctly when inlined · Issue #40823 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
[Yaml] Anchors are not parsed correctly when inlined #40823
Closed
@alcaeus

Description

@alcaeus

Symfony version(s) affected: Tested on 5.x

Description

Anchors are parsed correctly when not used inline, but ignored when they are. The test below highlights the problem.

How to reproduce

    public function testInlineReferences()
    {
        $this->assertEquals([
            'foo' => ['bar' => 'baz'],
            'bar' => ['foo' => 'baz']
        ], Yaml::parse(<<<'EOF'
foo: { bar: &baz baz }
bar: { foo: *baz }
EOF
        ));
    }

Possible Solution
References are passed by value to the Inline parser, which may be a BC break if changed. There is no handling whatsoever for anchors, which requires significant changes to the inline parser that I don't feel comfortable doing (for lack of experience with it).

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

      0