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

Skip to content
< 8000 div class="clearfix new-discussion-timeline js-check-all-container container-xl px-3 px-md-4 px-lg-5 mt-4" data-pjax="" data-turbo-frame="">

[Yaml] Anchors are not parsed correctly when inlined #40823

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
alcaeus opened this issue Apr 15, 2021 · 2 comments
Closed

[Yaml] Anchors are not parsed correctly when inlined #40823

alcaeus opened this issue Apr 15, 2021 · 2 comments

Comments

@alcaeus
Copy link
Contributor
alcaeus commented Apr 15, 2021

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).

@xabbuh
Copy link
Member
xabbuh commented Apr 15, 2021

I am going to take a look into it when I find some time.

@xabbuh
Copy link
Member
xabbuh commented Apr 23, 2021

see #40923

@fabpot fabpot closed this as completed Apr 29, 2021
fabpot added a commit that referenced this issue Apr 29, 2021
…tures (xabbuh)

This PR was merged into the 4.4 branch.

Discussion
----------

[Yaml] expose references detected in inline notation structures

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #40823
| License       | MIT
| Doc PR        |

Commits
-------

6d7d3fb expose references detected in inline notation structures
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants
0