dtolnay/serde-yaml

[BUG] Tagged null at end of flow sequence gives scanner error

Opened this issue · 0 comments

From what I can tell, [!tag] is supposed to be valid syntax. However, trying to parse it, we get

Error {
    kind: SCANNER,
    problem: "did not find expected whitespace or line break",
    problem_mark: Mark {
        line: 1,
        column: 6,
    },
    context: "while scanning a tag",
    context_mark: Mark {
        line: 1,
        column: 2,
    },
}

Adding a trailing space, newline, or comma makes it parse correctly:

[!tag,]

is parsed as

Sequence [
    TaggedValue {
        tag: !tag,
        value: Null,
    },
]