File: scope.txtar

package info (click to toggle)
golang-github-cue-lang-cue 0.14.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 19,644 kB
  • sloc: makefile: 20; sh: 15
file content (224 lines) | stat: -rw-r--r-- 3,168 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
-- in.cue --
a: {
	{{
		b
		c
		d: b
		e: c
	}}
	c: {}
}
b: {

}
s: "foo"
c: s

// s is technically in a new struct here so it will have a one higher count than
// the one before.
d: [s]: 3

e: {}
e & {// Is this allowed? Probably not as per comprehension rule (ref fixes.)
	e: {}
}

{X=["foo"]: b: X | null}
{[Y="bar"]: b: Y}

let B = {open: int}
f: B

schema: {
	next: _schema_1
}

let _schema_1 = schema
-- out/compile --
--- in.cue
{
  a: {
    {
      {
        〈3;b〉
        〈2;c〉
        d: 〈3;b〉
        e: 〈2;c〉
      }
    }
    c: {}
  }
  b: {}
  s: "foo"
  c: 〈0;s〉
  d: {
    [〈1;s〉]: 3
  }
  e: {}
  (〈0;e〉 & {
    e: {}
  })
  {
    ["foo"]: {
      b: (〈1;(〈0;-〉)〉|null)
    }
  }
  {
    ["bar"]: {
      b: 〈1;-〉
    }
  }
  let B#1 = {
    open: int
  }
  f: 〈0;let B#1〉
  schema: {
    next: 〈1;let _schema_1#2〉
  }
  let _schema_1#2 = 〈0;schema〉
}
-- out/evalalpha/stats --
Leaks:  0
Freed:  17
Reused: 3
Allocs: 14
Retain: 0

Unifications: 17
Conjuncts:    32
Disjuncts:    0
Notifications: 2

NumCloseIDs: 13
-- diff/-out/evalalpha/stats<==>+out/eval/stats --
diff old new
--- old
+++ new
@@ -1,9 +1,12 @@
-Leaks:  2
-Freed:  48
-Reused: 45
-Allocs: 5
-Retain: 8
-
-Unifications: 50
-Conjuncts:    102
-Disjuncts:    54
+Leaks:  0
+Freed:  17
+Reused: 3
+Allocs: 14
+Retain: 0
+
+Unifications: 17
+Conjuncts:    32
+Disjuncts:    0
+Notifications: 2
+
+NumCloseIDs: 13
-- out/eval/stats --
Leaks:  2
Freed:  48
Reused: 45
Allocs: 5
Retain: 8

Unifications: 50
Conjuncts:    102
Disjuncts:    54
-- out/evalalpha --
Errors:
schema.next: structural cycle

Result:
(_|_){
  // [structural cycle]
  a: (struct){
    d: (struct){
    }
    e: (struct){
    }
    c: (struct){
    }
  }
  b: (struct){
  }
  s: (string){ "foo" }
  c: (string){ "foo" }
  d: (struct){
  }
  e: (struct){
  }
  let B#1 = (struct){
    open: (int){ int }
  }
  f: (struct){
    open: (int){ int }
  }
  schema: (_|_){
    // [structural cycle]
    next: (_|_){
      // [structural cycle] schema.next: structural cycle
    }
  }
  let _schema_1#2 = (_|_){
    // [structural cycle]
  }
}
-- diff/-out/evalalpha<==>+out/eval --
diff old new
--- old
+++ new
@@ -33,7 +33,6 @@
     }
   }
   let _schema_1#2 = (_|_){
-    // [structural cycle] _schema_1: structural cycle:
-    //     ./in.cue:32:8
+    // [structural cycle]
   }
 }
-- diff/todo/p3 --
Structural cycle reported in different location. Seems fine, as
ultimately we need to print the paths of the cycle anyway.
Now also reports a position.
-- out/eval --
Errors:
schema.next: structural cycle

Result:
(_|_){
  // [structural cycle]
  a: (struct){
    d: (struct){
    }
    e: (struct){
    }
    c: (struct){
    }
  }
  b: (struct){
  }
  s: (string){ "foo" }
  c: (string){ "foo" }
  d: (struct){
  }
  e: (struct){
  }
  let B#1 = (struct){
    open: (int){ int }
  }
  f: (struct){
    open: (int){ int }
  }
  schema: (_|_){
    // [structural cycle]
    next: (_|_){
      // [structural cycle] schema.next: structural cycle
    }
  }
  let _schema_1#2 = (_|_){
    // [structural cycle] _schema_1: structural cycle:
    //     ./in.cue:32:8
  }
}