blob: 72e0a0dd4f14b312937f9ebae0b040a9889dfeb8 [file] [log] [blame]
itchynycc7597c2024-04-01 14:54:36 +02001%YAML 1.2
2%TAG ! tag:yaml.org,2002: # primary tag handle
3%TAG !! tag:yaml.org,2002: # secondary tag handle
4%TAG !yaml! tag:yaml.org,2002: # named tag handle
5---
6- !str 0 # primary tag handle
7- !!str 0 # secondary tag handle
8- !yaml!str 0 # named tag handle
9---
10
11boolean: [false, true, FALSE, TRUE, False, True]
12null: [null, ~,]
13integer: [12345, -12_345, +12_345]
14float: [
15 12345.15, -12_345.15, +12_345.15, 1.23015e+3,
16 -12_345.15e+10, +12_345.15e-10, 1.234_515e-10
17]
18binary: [0b101010, -0b1010_1010, +0b1010_1010]
19octal: [0777, 0o777, +0777, -0o777]
20hexadecimal: [0xFEFF_0000, -0xabcd_ef00, +0x1234_5678]
21sexagesimal: [10:20:30, -19:29:39, +19:29:39]
22infinity: [.inf, -.Inf, +.INF]
23not a number: [.nan, .NaN, .NAN]
24
25plain strings:
26 - a b c
itchynyaa495122024-07-21 09:21:20 +020027 - a:b & c @ d# e * f # comment
itchynycc7597c2024-04-01 14:54:36 +020028 - {{ f(' ') }} #8234
29double quoted strings:
30 - ""
31 - "a b c": "d e f" # comment
32 - "\\\"\a\b\f\n\r\t\v\0\_\ \N\L\P\x41\u0041\U00000041"
33single quoted strings:
34 - ''
35 - 'a b c': 'd e f' # comment
36 - 'a''b''c'
37
38block folded string: >
39 foo
40 bar: 1
41
42 baz: null
43
44 "qux"
45block literal string: |
46 foo
47 bar: 1
48
49 baz: null
50
51 'qux'
52
53chomping strings:
54 - block folded string: >- # comment
55 foo
56 bar: 1
57 - block literal string: |+ # comment
58 foo
59 bar: 1
60 - |- #11517
61 foo "\"
62 bar: 1
63block indentation indicator:
64 - block folded string: >1 # comment
65 foo
66 bar: 1
67 - block literal string: |1- # comment
68 foo
69 bar: 1
70 - |-1 # comment
71 foo
72 bar: 1
73
74flow collection:
75 empty sequence: []
76 empty mapping: {}
77 flow sequence: [foo, bar, baz]
78 flow mapping: {foo: bar, baz: qux}
79 flow string:
80 foo
81 bar
82 baz
83 "double quoted \" string": "
84 foo
85 bar
86 baz"
87 'single quoted '' string': '
88 foo
89 bar
90 baz'
91 inside block mapping:
92 foo: {bar: baz}
93 bar: ["foo": {baz: qux}]
itchynyaa495122024-07-21 09:21:20 +020094 flow:collection: [foo # comment
itchynycc7597c2024-04-01 14:54:36 +020095 , {bar: [{ # comment
itchynyaa495122024-07-21 09:21:20 +020096 baz:
97 '
itchynycc7597c2024-04-01 14:54:36 +020098 qux # not comment
99 ' # comment
100 }]}]
101
102explicit mapping:
103 ? foo # comment
104 : bar # comment
105 ? - foo
106 - bar
107 : - baz
108 - qux
109 ? [1, 2, 3]
110 : ? 1
111 : one
112 ? 2
113 : - ? 3
114 : three
115 - {?4: four, ? 5: five, ? # comment
116 6: # comment
117 {7:seven}}
118
119mapping merge:
120 foo: &foo
121 bar: baz
122 bar:
123 <<: *foo
124 baz: &bar
125 foo: [*foo]
126 qux:
127 <<: [*foo, *bar]
128 baz: {<<: *foo, qux: [{<< : *foo}]}