[PATCH] Detect malformed yaml sequence in yaml::Input::beginSequence()

William Fisher william.w.fisher at gmail.com
Mon Dec 29 11:11:11 PST 2014


This should say:

YAMLIO does *not* report an error if the yaml item is not a sequence.

On Mon, Dec 29, 2014 at 10:40 AM, William Fisher
<william.w.fisher at gmail.com> wrote:
> When reading a yaml::SequenceTraits object, YAMLIO does report an
> error if the yaml item is not a sequence. Instead, YAMLIO reads an
> empty sequence. For example:
>
> ---
> seq:
>     foo: 1
>     bar: 2
> ...
>
> If `seq` is a SequenceTraits object, then reading the above yaml will
> yield `seq` as an empty sequence.  The enclosed patch reports an error
> for the above mapping ("not a sequence")
>
> Null and empty nodes are still interpreted as empty sequences:
>
> ---
> seq1:               # Empty node okay
> ---
> seq2:  null       # null okay
> ...



More information about the llvm-commits mailing list