Skip to content

Allow question marks in plain scalars in flow collections#105

Merged
perlpunk merged 1 commit intoyaml:release/0.2.5from
perlpunk:question-in-plain
Jun 1, 2020
Merged

Allow question marks in plain scalars in flow collections#105
perlpunk merged 1 commit intoyaml:release/0.2.5from
perlpunk:question-in-plain

Conversation

@perlpunk
Copy link
Copy Markdown
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
Copy Markdown
Member Author

Note: add test to yaml-test-suite:

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

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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 force-pushed the question-in-plain branch from ca86cc0 to 96f7638 Compare June 1, 2020 19:25
@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