-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Yaml] fix lexing nested sequences/mappings #33763
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
Conversation
xabbuh
commented
Sep 30, 2019
•
edited
Loading
edited
Q | A |
---|---|
Branch? | 4.4 |
Bug fix? | yes |
New feature? | no |
Deprecations? | no |
Tickets | #34805, #37788, #37876, #39011, #39013, #39064 |
License | MIT |
Doc PR |
@xabbuh Is it something you're still willing to work on? |
4279223
to
800a703
Compare
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.
Nicely done.
I just missed a test with strings in mappings/sequences containing brackets which has been fixed in this PR as well.
As a possible test the following part of inlineNotationSpanningMultipleLinesProvider
passed successfully.
'nested collections containing strings with bracket chars' => [
[['ba[r'], ['[ba]r'], ['bar]'], ['foo' => 'bar{'], ['foo' => 'b{ar}'], ['foo' => 'bar}']],
<<<YAML
[
[
"ba[r"
],
[
'[ba]r'
],
[
"bar]"
],
{
foo: "bar{"
},
{
foo: "b{ar}"
},
{
foo: 'bar}'
}
]
728cba9
to
f21bd46
Compare
This is ready to be reviewed. |
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.
Escaped quotes are not yet skipped in lexInlineQuotedString
and are leading to problems for example in this yaml test:
[
["te\"st"],["test"]
]
Another simple error case is:
[
["te\"st]"]
]
d418d1d
to
0e38c33
Compare
There is (now) another small issue with escaped backslashes in quotes treated as the escape for the quote.
I got a segmentation error writing the yam like this: |
Did you mean |
Depends how it is declared. In HEREDOC
|
@simonberger I don't see a difference here (see also https://3v4l.org/iOVjl). Could you please send a PR with a test case that you have in mind to my branch if you still think that something isn't working as expected? |
@xabbuh I am sorry. This was indeed my wrong test. |
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.
My pleasure. LGTM now.
Thank you @xabbuh. |
@xabbuh Can I ask you to merge 4.4 into 5.1? This PR gives me a headache. |
@derrabus done 👍 |