this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

internal/core/adt: remove some Vertex-related fields

As well as one state mode. Eventually, the
vertexStatus should go in its entirety, but
that needs a bit more work.

Signed-off-by: Marcel van Lohuizen <mpvl@gmail.com>
Change-Id: I8e0b36080e29cad93d9d8cb723d24c5f10f083ff
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1220006
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>

+3 -28
-20
internal/core/adt/composite.go
··· 196 196 // the per-Environment value cache. 197 197 MultiLet bool 198 198 199 - // After this is set, no more arcs may be added during evaluation. This is 200 - // set, for instance, after a Vertex is used as a source for comprehensions, 201 - // or any other operation that relies on the set of arcs being constant. 202 - LockArcs bool 203 - 204 199 // IsDynamic signifies whether this struct is computed as part of an 205 200 // expression and not part of the static evaluation tree. 206 201 // Used for cycle detection. ··· 232 227 // If a node is shared, the user should be careful with traversal. 233 228 // The debug printer, for instance, takes extra care not to print in a loop. 234 229 IsShared bool 235 - 236 - // IsCyclic is true if a node is cyclic, for instance if its value is 237 - // a cyclic reference to a shared node or if the value is a conjunction 238 - // of which at least one value is cyclic (not yet supported). 239 - IsCyclic bool 240 230 241 231 // ArcType indicates the level of optionality of this arc. 242 232 ArcType ArcType ··· 542 532 // conjuncts is the state reached when all conjuncts have been evaluated, 543 533 // but without recursively processing arcs. 544 534 conjuncts 545 - 546 - // evaluatingArcs indicates that the arcs of the Vertex are currently being 547 - // evaluated. If this is encountered it indicates a structural cycle. 548 - // Value does not have to be nil 549 - evaluatingArcs 550 - 551 - // TODO: introduce a "frozen" state. Right now a node may marked and used 552 - // as finalized, before all tasks have completed. We should introduce a 553 - // frozen state that simply checks that all remaining tasks are idempotent 554 - // and errors if they are not. 555 535 556 536 // finalized means that this node is fully evaluated and that the results 557 537 // are save to use without further consideration.
+3 -4
internal/core/adt/vertexstatus_string.go
··· 12 12 _ = x[evaluating-1] 13 13 _ = x[partial-2] 14 14 _ = x[conjuncts-3] 15 - _ = x[evaluatingArcs-4] 16 - _ = x[finalized-5] 15 + _ = x[finalized-4] 17 16 } 18 17 19 - const _vertexStatus_name = "unprocessedevaluatingpartialconjunctsevaluatingArcsfinalized" 18 + const _vertexStatus_name = "unprocessedevaluatingpartialconjunctsfinalized" 20 19 21 - var _vertexStatus_index = [...]uint8{0, 11, 21, 28, 37, 51, 60} 20 + var _vertexStatus_index = [...]uint8{0, 11, 21, 28, 37, 46} 22 21 23 22 func (i vertexStatus) String() string { 24 23 if i < 0 || i >= vertexStatus(len(_vertexStatus_index)-1) {
-1
internal/core/compile/builtin.go
··· 91 91 92 92 v := args[0] 93 93 if x, ok := v.(*adt.Vertex); ok { 94 - x.LockArcs = true 95 94 switch x.BaseValue.(type) { 96 95 case nil: 97 96 // This should not happen, but be defensive.
-3
internal/core/debug/debug.go
··· 138 138 // but rather to the original arc that subsequently points to a 139 139 // disjunct. 140 140 v0 = v0.DerefDisjunct() 141 - isCyclic := v0.IsCyclic 142 141 s, ok := v0.BaseValue.(*adt.Vertex) 143 142 v1 := v0.DerefValue() 144 143 useReference := v0.IsShared && !v1.Internal() 145 - isCyclic = isCyclic || v1.IsCyclic 146 - _ = isCyclic 147 144 // NOTE(debug): use this line instead of the following to expand shared 148 145 // cases where it is safe to do so. 149 146 // if useReference && isCyclic && ok && len(v.Arcs) > 0 {