Skip to content

Allow question marks inside of plain scalars in flow collections #128

@perlpunk

Description

@perlpunk

See also yaml/libyaml#105

http://yaml.org/spec/1.1/#id907281
Question marks aren't mentioned as special inside of plain scalars here.
To be an indicator for an explicit key, it must be at the beginning and followed by a space or newline.

The following cases should be allowed:

[foo?bar]
[foo ? bar]

This would allow [ http://example/query?a=b ].

Even this one should be allowed, but it would potentially break existing code:

[?foo]
# same as
["?foo"]
# but currently parsed as
[? foo ]

The Spec:

The first plain character is further restricted to avoid most indicators as these
would cause ambiguity with various YAML structures. However, the first character
may be “-”, “?” or “:” provided it is followed by a non-space character.

[157] ns-plain-first-char(c) ::= ( ns-plain-char(c) - c-indicator )
                                 | ( ( “-” | “?” | “:” ) ns-plain-char(c) )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions