Debian Codegraph @

cmd/go-yaml/testdata/positions.yaml

raw symbols SCIP
1 # Position format tests for go-yaml CLI
2
3 - name: Single character position
4 text: |
5 a
6 TOKEN: |
7 - {token: STREAM-START, pos: '1:1'}
8 - {token: SCALAR, value: a, pos: '1:1-2'}
9 - {token: STREAM-END, pos: '2:1'}
10
11 - name: |
12 Same line range
13 text: |
14 key: value
15 TOKEN: |
16 - {token: STREAM-START, pos: '1:1'}
17 - {token: BLOCK-MAPPING-START, pos: '1:1'}
18 - {token: KEY, pos: '1:1'}
19 - {token: SCALAR, value: key, pos: '1:1-4'}
20 - {token: VALUE, pos: '1:4-5'}
21 - {token: SCALAR, value: value, pos: '1:6-11'}
22 - {token: BLOCK-END, pos: '2:1'}
23 - {token: STREAM-END, pos: '2:1'}
24
25 - name: |
26 Multi-line literal scalar
27 text: |
28 key: |
29 line1
30 line2
31 TOKEN: |
32 - {token: STREAM-START, pos: '1:1'}
33 - {token: BLOCK-MAPPING-START, pos: '1:1'}
34 - {token: KEY, pos: '1:1'}
35 - {token: SCALAR, value: key, pos: '1:1-4'}
36 - {token: VALUE, pos: '1:4-5'}
37 - {token: SCALAR, value: "line1\nline2\n", style: Literal, pos: '1:6-4:1'}
38 - {token: BLOCK-END, pos: '4:1'}
39 - {token: STREAM-END, pos: '4:1'}
40
41 - name: |
42 Comment position with line comment
43 text: |
44 a: b #c
45 TOKEN: |
46 - {token: STREAM-START, pos: '1:1'}
47 - {token: BLOCK-MAPPING-START, pos: '1:1'}
48 - {token: KEY, pos: '1:1'}
49 - {token: SCALAR, value: a, pos: '1:1-2'}
50 - {token: VALUE, pos: '1:2-3'}
51 - {token: COMMENT, line: '#c', pos: '1:6-8'}
52 - {token: SCALAR, value: b, pos: '1:4-5'}
53 - {token: BLOCK-END, pos: '2:1'}
54 - {token: STREAM-END, pos: '2:1'}