mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-24 13:18:17 +00:00
Add simple support for tags in YAML I/O
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194644 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -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
|
||||
========
|
||||
|
||||
|
||||
Reference in New Issue
Block a user