YAML教程@第九章 YAML语法字符

版权声明:忠于祖国,忠于人民 https://blog.csdn.net/boss2967/article/details/89556843
各种类型的字符用于各种功能
指示符字符

1_它表示块序列条目

2?它表示映射键

3:它表示映射值

4,它表示流集合条目

5[它开始流序列

6]它结束流序列

7{它启动流映射

8}它结束流映射

9#它表示注释

10&它表示节点的锚属性

11*它表示别名节点

12!它表示节点的标签

13Ι它表示一个字面块标量

14>它表示折叠块标量

15’单引号围绕引用的流标量

16"双引号包围双引号流标量

17%它表示使用的指令

示例
%YAML 1.1
---
!!map {
   ? !!str "sequence"
   : !!seq [
      !!str "one", !!str "two"
   ],
   ? !!str "mapping"
   : !!map {
      ? !!str "sky" : !!str "blue",
      ? !!str "sea" : !!str "green",
   }
}

# This represents
# only comments.
---
!!map1 {
   ? !!str "anchored"
   : !local &A1 "value",
   ? !!str "alias"
   : *A1,
}
!!str "text"

猜你喜欢

转载自blog.csdn.net/boss2967/article/details/89556843