-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Yaml Parser] fixed Parser to skip comments when inlining sequences #38040
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
[Yaml Parser] fixed Parser to skip comments when inlining sequences #38040
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for having a look and submitting.
src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services9.yml
Outdated
Show resolved
Hide resolved
]] | ||
YAML | ||
], | ||
'with-comments-trailing-comma' => [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fail to see how this test case differs from the previous one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops you're right. The 'with-comments' was meant to be without a comma after the 2nd array element. I've fixed it.
Thank you @korve. |
The parser didn't skip comments when parsing values in a sequence. This resulted in the YamlFileLoader trying to
parse a comment as a IteratorArgument which resulted in a InvalidArgumentException.
Consider the following valid yaml:
The parser would generate the following array:
After this fix the parser will generate the following array:
['bar']
This bug only appeared for me in 4.4