Skip to content
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

Allow question marks in plain scalars in flow collections #105

Merged
merged 1 commit into from
Jun 1, 2020

Conversation

perlpunk
Copy link
Member

@perlpunk perlpunk commented Feb 3, 2018

See http://yaml.org/spec/1.1/#id907281

The question mark isn't mentioned as something special here, only
,[]{}

This commit will allow

[foo?bar]
[foo ? bar]

The PR does only change the behaviour when the question mark is in the middle or at the end of the string, not at the beginning, e.g. [?foo] is handled by a different part of the code.

@perlpunk
Copy link
Member Author

Note: add test to yaml-test-suite:

- [foo?bar]
- [foo ? bar]

Copy link
Member

@ingydotnet ingydotnet left a comment

Choose a reason for hiding this comment

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

@perlpunk Is it easy to allow foo?bar and foo? bar and foo bar?, but not allow foo ? bar or foo ?bar?

The latter ones seem like they would cause more confusion that they'd solve.

@perlpunk
Copy link
Member Author

Is it easy to allow foo?bar and foo? bar and foo bar?, but not allow foo ? bar or foo ?bar?

I think that's not so easy.
And if the ? marker will be removed in flow style in the next YAML version, then this would remove any ambiguity.

Copy link
Member

@ingydotnet ingydotnet left a comment

Choose a reason for hiding this comment

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

Thanks,

See http://yaml.org/spec/1.1/#id907281

The question mark isn't mentioned as something special here, only
,[]{}

This commit will allow

[foo?bar]
[foo ? bar]

The PR does only change the behaviour when the question mark is in the middle or
at the end of the string, not at the beginning, e.g. [?foo] is handled by
a different part of the code.
@perlpunk perlpunk changed the base branch from master to release/0.2.5 June 1, 2020 19:27
@perlpunk perlpunk merged commit 1008696 into yaml:release/0.2.5 Jun 1, 2020
@perlpunk perlpunk deleted the question-in-plain branch June 1, 2020 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants