1--- %YAML:1.0
2test: Comments at the end of a line
3brief: >
4    Comments at the end of a line
5yaml: |
6    ex1: "foo # bar"
7    ex2: "foo # bar" # comment
8    ex3: 'foo # bar' # comment
9    ex4: foo # comment
10    ex5: foo	#	comment with tab before
11    ex6: foo#foo # comment here
12    ex7: foo 	# ignore me # and me
13php: |
14    ['ex1' => 'foo # bar', 'ex2' => 'foo # bar', 'ex3' => 'foo # bar', 'ex4' => 'foo', 'ex5' => 'foo', 'ex6' => 'foo#foo', 'ex7' => 'foo']
15---
16test: Comments in the middle
17brief: >
18  Comments in the middle
19yaml: |
20    foo:
21    # some comment
22    # some comment
23      bar: foo
24    # some comment
25    # some comment
26php: |
27    ['foo' => ['bar' => 'foo']]
28---
29test: Comments on a hash line
30brief: >
31  Comments on a hash line
32yaml: |
33    foo:   # a comment
34      foo: bar # a comment
35php: |
36    ['foo' => ['foo' => 'bar']]
37---
38test: 'Value starting with a #'
39brief: >
40  'Value starting with a #'
41yaml: |
42    foo:   '#bar'
43php: |
44    ['foo' => '#bar']
45---
46test: Document starting with a comment and a separator
47brief: >
48  Commenting before document start is allowed
49yaml: |
50    # document comment
51    ---
52    foo: bar # a comment
53php: |
54    ['foo' => 'bar']
55---
56test: Comment containing a colon on a hash line
57brief: >
58    Comment containing a colon on a scalar line
59yaml: 'foo # comment: this is also part of the comment'
60php: |
61    'foo'
62---
63test: 'Hash key containing a #'
64brief: >
65    'Hash key containing a #'
66yaml: 'foo#bar: baz'
67php: |
68    ['foo#bar' => 'baz']
69---
70test: 'Hash key ending with a space and a #'
71brief: >
72    'Hash key ending with a space and a #'
73yaml: |
74    'foo #': baz
75php: |
76    ['foo #' => 'baz']
77