| 1 |
|
| 2 |
|
| 3 |
- name: Simple line comment on a pair |
| 4 |
text: | |
| 5 |
a: b #c |
| 6 |
token: | |
| 7 |
- {token: STREAM-START} |
| 8 |
- {token: BLOCK-MAPPING-START} |
| 9 |
- {token: KEY} |
| 10 |
- {token: SCALAR, value: a} |
| 11 |
- {token: VALUE} |
| 12 |
- {token: COMMENT, line: '#c'} |
| 13 |
- {token: SCALAR, value: b} |
| 14 |
- {token: BLOCK-END} |
| 15 |
- {token: STREAM-END} |
| 16 |
TOKEN: | |
| 17 |
- {token: STREAM-START, pos: '1:1'} |
| 18 |
- {token: BLOCK-MAPPING-START, pos: '1:1'} |
| 19 |
- {token: KEY, pos: '1:1'} |
| 20 |
- {token: SCALAR, value: a, pos: '1:1-2'} |
| 21 |
- {token: VALUE, pos: '1:2-3'} |
| 22 |
- {token: COMMENT, line: '#c', pos: '1:6-8'} |
| 23 |
- {token: SCALAR, value: b, pos: '1:4-5'} |
| 24 |
- {token: BLOCK-END, pos: '2:1'} |
| 25 |
- {token: STREAM-END, pos: '2:1'} |
| 26 |
event: | |
| 27 |
- {event: DOCUMENT-START} |
| 28 |
- {event: MAPPING-START} |
| 29 |
- {event: SCALAR, value: a} |
| 30 |
- {event: SCALAR, value: b, line: '#c'} |
| 31 |
- {event: MAPPING-END} |
| 32 |
- {event: DOCUMENT-END} |
| 33 |
|
| 34 |
- name: Head, line, and foot comments |
| 35 |
text: | |
| 36 |
# head comment |
| 37 |
key: value # line comment |
| 38 |
# foot comment |
| 39 |
token: | |
| 40 |
- {token: COMMENT, head: '# head comment'} |
| 41 |
- {token: STREAM-START} |
| 42 |
- {token: BLOCK-MAPPING-START} |
| 43 |
- {token: KEY} |
| 44 |
- {token: SCALAR, value: key} |
| 45 |
- {token: VALUE} |
| 46 |
- {token: COMMENT, line: '# line comment'} |
| 47 |
- {token: COMMENT, foot: '# foot comment'} |
| 48 |
- {token: SCALAR, value: value} |
| 49 |
- {token: BLOCK-END} |
| 50 |
- {token: STREAM-END} |
| 51 |
event: | |
| 52 |
- {event: DOCUMENT-START} |
| 53 |
- {event: MAPPING-START} |
| 54 |
- {event: SCALAR, value: key, head: '# head comment'} |
| 55 |
- {event: SCALAR, value: value, line: '# line comment', foot: '# foot comment'} |
| 56 |
- {event: MAPPING-END} |
| 57 |
- {event: DOCUMENT-END} |
| 58 |
|
| 59 |
- name: Multiple head comments |
| 60 |
text: | |
| 61 |
# comment1 |
| 62 |
# comment2 |
| 63 |
key: value |
| 64 |
token: | |
| 65 |
- {token: COMMENT, head: "# comment1\n# comment2"} |
| 66 |
- {token: STREAM-START} |
| 67 |
- {token: BLOCK-MAPPING-START} |
| 68 |
- {token: KEY} |
| 69 |
- {token: SCALAR, value: key} |
| 70 |
- {token: VALUE} |
| 71 |
- {token: SCALAR, value: value} |
| 72 |
- {token: BLOCK-END} |
| 73 |
- {token: STREAM-END} |