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] parse inlined tags without values#23757

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
xabbuh merged 1 commit intosymfony:masterfromxabbuh:yaml-empty-tag-values
Aug 10, 2017

Conversation

@xabbuh
Copy link
Member

QA
Branch?master
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets
LicenseMIT
Doc PR

@GuilhemN
Copy link
Contributor

Tag values are always strings as they are not evaluated, I don't think this change makes sense.

}

$tagLength =strcspn($value,"\t\n",$i +1);
$tagLength =strcspn($value,"\t\n".$stopOn,$i +1);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

In fact indicators must always be forbidden in tags handle (seehttp://www.yaml.org/spec/1.2/spec.html#ns-tag-char).
It should be done in 3.3 as a bug fix imo.

@xabbuh
Copy link
MemberAuthor

Tag values are always strings as they are not evaluated, I don't think this change makes sense.

I didn't find anything in the specs that forbids having a tag without a value. Did I miss anything?

@nicolas-grekas
Copy link
Member

at leasthttp://yaml-online-parser.appspot.com/ forbids it

@GuilhemN
Copy link
Contributor

GuilhemN commentedAug 2, 2017
edited
Loading

http://yaml-online-parser.appspot.com/ is buggy then :)

I didn't find anything in the specs that forbids having a tag without a value. Did I miss anything?

Having a tag without a value is allowed, I'm just saying the value is notnull then but"".

Edit: the only thing we should change is forbidding indicators in a tag name.

@nicolas-grekas
Copy link
Member

OK, it's not buggy, it's that a space is required after the tag, and then it resolves to the empty string yes.

@GuilhemN
Copy link
Contributor

@nicolas-grekas the reference ishttp://ben-kiki.org/ypaste/data/497/index.html :)

} is forbidden in tag names so the parser should properly know that the tag is ended and should not need a space.

@xabbuhxabbuhforce-pushed theyaml-empty-tag-values branch fromcc56340 to75d6f5bCompareAugust 3, 2017 09:22
@xabbuh
Copy link
MemberAuthor

xabbuh commentedAug 3, 2017
edited
Loading

tags without values are now getting parsed as empty strings (their values are parsed as empty strings)

}

$tagLength =strcspn($value,"\t\n",$i +1);
$tagLength =strcspn($value,"\t\n".$stopOn,$i +1);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Imo this function should just be updated to:

privatestaticfunction parseTag($value, &$i,$flags)     {if ('!' !==$value[$i]) {return;         }$tagLength =strcspn($value,"\t\n,[]{}",$i +1);// ...

@xabbuh
Copy link
MemberAuthor

Let's wait here until we have merged#22913 so we can indeed forbid indicator characters in tags (as written in#23757 (comment)). Currently, we cannot do that because we would then break parsing the!php/object tag.

GuilhemN reacted with thumbs up emoji

@GuilhemN
Copy link
Contributor

#22913 and#23790 have been merged :)

@xabbuhxabbuhforce-pushed theyaml-empty-tag-values branch from75d6f5b tod67e1ddCompareAugust 7, 2017 11:00
@xabbuh
Copy link
MemberAuthor

rebased and ready

@xabbuhxabbuhforce-pushed theyaml-empty-tag-values branch fromd67e1dd to3bb0a3fCompareAugust 7, 2017 11:31
@xabbuhxabbuh merged commit3bb0a3f intosymfony:masterAug 10, 2017
xabbuh added a commit that referenced this pull requestAug 10, 2017
This PR was merged into the 4.0-dev branch.Discussion----------[Yaml] parse inlined tags without values| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets || License       | MIT| Doc PR        |Commits-------3bb0a3f [Yaml] parse inlined tags without values
@xabbuhxabbuh deleted the yaml-empty-tag-values branchAugust 10, 2017 06:49
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

@chalasrchalasrchalasr approved these changes

+1 more reviewer

@GuilhemNGuilhemNGuilhemN approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

4.0

Development

Successfully merging this pull request may close these issues.

5 participants

@xabbuh@GuilhemN@nicolas-grekas@chalasr@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp