Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
fabpot merged 1 commit intosymfony:4.4fromxabbuh:pr-33658
Nov 19, 2020

Conversation

@xabbuh
Copy link
Member

@xabbuhxabbuh commentedSep 30, 2019
edited
Loading

QA
Branch?4.4
Bug fix?yes
New feature?no
Deprecations?no
Tickets#34805,#37788,#37876,#39011,#39013,#39064
LicenseMIT
Doc PR

@nicolas-grekasnicolas-grekas modified the milestones:next,4.4Oct 27, 2019
@fabpot
Copy link
Member

@xabbuh Is it something you're still willing to work on?

Copy link
Contributor

@simonbergersimonberger left a 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 ofinlineNotationSpanningMultipleLinesProvider 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}'    }]

@xabbuh
Copy link
MemberAuthor

xabbuh commentedNov 15, 2020
edited
Loading

Many thanks to@RevZer0,@simonberger and@Matth--. I have added the tests you added in#37876,#39013, and#39064 here.

RevZer0 reacted with hooray emoji

@xabbuhxabbuhforce-pushed thepr-33658 branch 3 times, most recently from728cba9 tof21bd46CompareNovember 15, 2020 17:28
@xabbuh
Copy link
MemberAuthor

This is ready to be reviewed.

Copy link
Contributor

@simonbergersimonberger left a comment
edited
Loading

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 inlexInlineQuotedString and are leading to problems for example in this yaml test:

[    ["te\"st"],["test"]]

Another simple error case is:

[    ["te\"st]"]]

xabbuh reacted with thumbs up emoji
@simonberger
Copy link
Contributor

simonberger commentedNov 17, 2020
edited
Loading

There is (now) another small issue with escaped backslashes in quotes treated as the escape for the quote.

'escaped backslash in mapping' => [                [['"']],                <<<YAML[    ["\\"]]YAML            ]

I got a segmentation error writing the yam like this:[["\\"]]. l didn't look further in. Should be related to the problem but maybe a boundary check isn't robust enough.

@xabbuh
Copy link
MemberAuthor

xabbuh commentedNov 17, 2020
edited
Loading

Did you mean[["\\\\"]]?[["\\"]] isn't valid YAML and runs into a parsing error for me locally.

@simonberger
Copy link
Contributor

Depends how it is declared. In HEREDOC[["\\"]]in quotes'[["\\\\"]]'.
There is also for me a parser error when using new lines, but there shouldn't.

Malformed inline YAML string: ""\"] ]]]" at line 3 (near "]")

@xabbuh
Copy link
MemberAuthor

@simonberger I don't see a difference here (see alsohttps://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?

@simonberger
Copy link
Contributor

@xabbuh I am sorry. This was indeed my wrong test.

Copy link
Contributor

@simonbergersimonberger left a 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.

codebymikey reacted with thumbs up emoji
@fabpot
Copy link
Member

Thank you@xabbuh.

@fabpotfabpot merged commit308231a intosymfony:4.4Nov 19, 2020
@xabbuhxabbuh deleted the pr-33658 branchNovember 19, 2020 07:49
@derrabus
Copy link
Member

@xabbuh Can I ask you to merge 4.4 into 5.1? This PR gives me a headache.

@xabbuh
Copy link
MemberAuthor

@derrabus done 👍

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@stofstofstof left review comments

@jderussejderussejderusse left review comments

+1 more reviewer

@simonbergersimonbergersimonberger approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

4.4

8 participants

@xabbuh@fabpot@simonberger@derrabus@stof@jderusse@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp