Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Yaml] fix parse error when unindented collections contain a comment#36683
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
xabbuh commentedMay 4, 2020
For 3.4? |
wdiesveld commentedMay 4, 2020
@xabbuh - I could not test it for 3.4 and 4.0, only for 5.0 - I get an out-of-mem error when running |
xabbuh commentedMay 4, 2020
@wdiesveld No problem, I have changed the base branch and rebased your changes. Thank you for working on this issue. |
fabpot commentedMay 4, 2020
Thank you@wdiesveld. |
Nyholm commentedMay 4, 2020
Awesome. Congratulations to your first contribution! |
Problem
The method
Parser::getNextEmbedBlockdid not determine the yaml-block correctly when there was a comment before the first unindented collection item. This was caused by the fact that the check for unindented collection items was done for thefirst line of the block only. So in case this first line is a comment, this check will result infalse, while in fact the parser is in an unindented collection.Solution
In the solution I implemented the parser will check for comment lines as well. As long as the loop encounters a comment line, it will check (in the next iteration) whether the line is an unindented collection item. So this check will be done until all comments before the first uncommented item are parsed.