[PATCH] Fix YAML sequences with default entries

Aaron Ballman aaron at aaronballman.com
Tue Aug 13 16:09:36 PDT 2013


When creating a YAML sequence where an element is a mapping that is
defaulted, the current implementation elides the element entirely,
which causes round-tripping problems.  Since the output drops the
defaulted entries, the input never receives the correct number of
entries in the sequence.

The attached patch resolves this issue by checking to see whether a
mapping operation is currently processing a sequence before deciding
to elide the mapped element.  Unit tests demonstrating the issue are
included.

~Aaron
-------------- next part --------------
A non-text attachment was scrubbed...
Name: yaml.patch
Type: application/octet-stream
Size: 3223 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130813/544094e2/attachment.obj>


More information about the llvm-commits mailing list