diff options
author | Nick Kledzik <kledzik@apple.com> | 2013-11-14 00:59:59 +0000 |
---|---|---|
committer | Nick Kledzik <kledzik@apple.com> | 2013-11-14 00:59:59 +0000 |
commit | 1e6033ca33c74a305457d5df87a738ee1b43fe79 (patch) | |
tree | 99ddfb80ca4df43f66f8d7f3c1c074f9e29f7b1e /llvm/docs/YamlIO.rst | |
parent | 7a2080793e8f45ae69dcd3c191401d43b27eb26b (diff) | |
download | bcm5719-llvm-1e6033ca33c74a305457d5df87a738ee1b43fe79.tar.gz bcm5719-llvm-1e6033ca33c74a305457d5df87a738ee1b43fe79.zip |
Add simple support for tags in YAML I/O
llvm-svn: 194644
Diffstat (limited to 'llvm/docs/YamlIO.rst')
-rw-r--r-- | llvm/docs/YamlIO.rst | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/llvm/docs/YamlIO.rst b/llvm/docs/YamlIO.rst index 79e07cd9897..3ecd03afb24 100644 --- a/llvm/docs/YamlIO.rst +++ b/llvm/docs/YamlIO.rst @@ -633,6 +633,20 @@ This works for both reading and writing. For example: }; +Tags +---- + +The YAML syntax supports tags as a way to specify the type of a node before +it is parsed. This allows dynamic types of nodes. But the YAML I/O model uses +static typing, so there are limits to how you can use tags with the YAML I/O +model. Recently, we added support to YAML I/O for checking/setting the optional +tag on a map. Using this functionality it is even possbile to support differnt +mappings, as long as they are convertable. + +To check a tag, inside your mapping() method you can use io.mapTag() to specify +what the tag should be. This will also add that tag when writing yaml. + + Sequence ======== |