Skip to content

Commit 0b96e3b

Browse files
committed
internal/core/adt: rename node to vertex
This allows introducing a node method, needed to satisfy an upcoming interface. Signed-off-by: Marcel van Lohuizen <[email protected]> Change-Id: I5b51752218882bb1d4a7d1edc06196268f130535 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1167911 Reviewed-by: Daniel Martí <[email protected]> TryBot-Result: CUEcueckoo <[email protected]> Unity-Result: CUE porcuepine <[email protected]>
1 parent 826f28c commit 0b96e3b

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

internal/core/adt/comprehension.go

+8-8
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ package adt
7272

7373
// envComprehension caches the result of a single comprehension.
7474
type envComprehension struct {
75-
comp *Comprehension
76-
node *Vertex // The Vertex from which the comprehension originates.
75+
comp *Comprehension
76+
vertex *Vertex // The Vertex from which the comprehension originates.
7777

7878
// runtime-related fields
7979

@@ -141,8 +141,8 @@ func (n *nodeContext) insertComprehension(
141141
ec := c.comp
142142
if ec == nil {
143143
ec = &envComprehension{
144-
comp: c,
145-
node: n.node,
144+
comp: c,
145+
vertex: n.node,
146146

147147
err: nil, // shut up linter
148148
envs: nil, // shut up linter
@@ -391,17 +391,17 @@ func (n *nodeContext) processComprehension(d *envYield, state vertexStatus) *Bot
391391
envs = append(envs, env)
392392
}
393393

394-
if err := ctx.yield(d.node, d.env, d.comp, state, f); err != nil {
394+
if err := ctx.yield(d.vertex, d.env, d.comp, state, f); err != nil {
395395
if err.IsIncomplete() {
396396
return err
397397
}
398398

399399
// continue to collect other errors.
400400
d.done = true
401401
d.inserted = true
402-
if d.node != nil {
403-
d.node.state.addBottom(err)
404-
ctx.PopArc(d.node)
402+
if d.vertex != nil {
403+
d.vertex.state.addBottom(err)
404+
ctx.PopArc(d.vertex)
405405
}
406406
return nil
407407
}

internal/core/adt/eval.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -669,10 +669,10 @@ func (n *nodeContext) incompleteErrors(final bool) *Bottom {
669669
// }
670670
// n := d.node.getNodeContext(ctx)
671671
// n.addBottom(err)
672-
if final && c.node != nil && c.node.status != finalized {
673-
n := c.node.getNodeContext(n.ctx, 0)
672+
if final && c.vertex != nil && c.vertex.status != finalized {
673+
n := c.vertex.getNodeContext(n.ctx, 0)
674674
n.addBottom(err)
675-
c.node = nil
675+
c.vertex = nil
676676
}
677677
}
678678
for _, c := range n.selfComprehensions {
@@ -698,10 +698,10 @@ func (n *nodeContext) incompleteErrors(final bool) *Bottom {
698698
// }
699699
// n := d.node.getNodeContext(ctx)
700700
// n.addBottom(err)
701-
if c.node != nil && c.node.status != finalized {
702-
n := c.node.getNodeContext(n.ctx, 0)
701+
if c.vertex != nil && c.vertex.status != finalized {
702+
n := c.vertex.getNodeContext(n.ctx, 0)
703703
n.addBottom(err)
704-
c.node = nil
704+
c.vertex = nil
705705
}
706706
}
707707
for _, x := range n.exprs {

0 commit comments

Comments
 (0)