Debian Codegraph @

cue/ast/astutil/testdata/resolve/comprehensions.txtar

raw
1 -- in.cue --
2 src: [{foo: 3}]
3
4 for k, v in src
5 let y = v.foo
6 if y > 3 {
7 x: [k, v, y]
8 }
9 -- out/resolve/in --
10 3[src]: Scope: 0[<nil>] Node: 0[]
11 6[foo]: Scope: 0[<nil>] Node: 0[]
12 8[k]: Scope: 0[<nil>] Node: 0[]
13 9[v]: Scope: 0[<nil>] Node: 0[]
14 10[src]: Scope: 1[*ast.File] Node: 0[[{foo: 3}]]
15 12[y]: Scope: 0[<nil>] Node: 0[]
16 13[v]: Scope: 7[*ast.ForClause] Node: 9[v]
17 14[foo]: Scope: 0[<nil>] Node: 0[]
18 15[y]: Scope: 11[*ast.LetClause] Node: 12[y]
19 18[x]: Scope: 0[<nil>] Node: 0[]
20 19[k]: Scope: 7[*ast.ForClause] Node: 8[k]
21 20[v]: Scope: 7[*ast.ForClause] Node: 9[v]
22 21[y]: Scope: 11[*ast.LetClause] Node: 12[y]
23 -- issue946.cue --
24 x: {for a in a {}}
25 y: {for aa in a {}}
26 -- out/resolve/issue946 --
27 3[x]: Scope: 0[<nil>] Node: 0[]
28 6[a]: Scope: 0[<nil>] Node: 0[]
29 7[a]: Scope: 0[<nil>] Node: 0[]
30 10[y]: Scope: 0[<nil>] Node: 0[]
31 13[aa]: Scope: 0[<nil>] Node: 0[]
32 14[a]: Scope: 0[<nil>] Node: 0[]