Skip to content

Commit

Permalink
internal/core/adt: unexport more methods
Browse files Browse the repository at this point in the history
Signed-off-by: Marcel van Lohuizen <mpvl@gmail.com>
Change-Id: I7b08d5dc8ec323bf2cfed6f008a97736a5af4d8f
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/551411
Reviewed-by: Aram Hăvărneanu <aram@cue.works>
Reviewed-by: Roger Peppe <rogpeppe@gmail.com>
Unity-Result: CUEcueckoo <cueckoo@cuelang.org>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
  • Loading branch information
mpvl committed Mar 24, 2023
1 parent 185eed7 commit ce65141
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions internal/core/adt/binop.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ func BinOp(c *OpContext, op Op, left, right Value) Value {
return c.newBool(false)
}
for i, e := range x {
a, _ := c.Concrete(nil, e, op)
b, _ := c.Concrete(nil, y[i], op)
a, _ := c.concrete(nil, e, op)
b, _ := c.concrete(nil, y[i], op)
if !test(c, EqualOp, a, b) {
return c.newBool(false)
}
Expand Down Expand Up @@ -113,8 +113,8 @@ func BinOp(c *OpContext, op Op, left, right Value) Value {
return c.newBool(false)
}
for i, e := range x {
a, _ := c.Concrete(nil, e, op)
b, _ := c.Concrete(nil, y[i], op)
a, _ := c.concrete(nil, e, op)
b, _ := c.concrete(nil, y[i], op)
if !test(c, EqualOp, a, b) {
return c.newBool(true)
}
Expand Down
10 changes: 5 additions & 5 deletions internal/core/adt/composite.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,8 @@ type Vertex struct {
Structs []*StructInfo
}

// UpdateArcType updates v.ArcType if t is more restrictive.
func (v *Vertex) UpdateArcType(t ArcType) {
// updateArcType updates v.ArcType if t is more restrictive.
func (v *Vertex) updateArcType(t ArcType) {
if t < v.ArcType {
v.ArcType = t
}
Expand Down Expand Up @@ -829,7 +829,7 @@ func (v *Vertex) Elems() []*Vertex {
func (v *Vertex) GetArc(c *OpContext, f Feature, t ArcType) (arc *Vertex, isNew bool) {
arc = v.Lookup(f)
if arc != nil {
arc.UpdateArcType(t)
arc.updateArcType(t)
return arc, false
}

Expand Down Expand Up @@ -879,9 +879,9 @@ func (v *Vertex) hasConjunct(c Conjunct) (added bool) {
switch f := c.x.(type) {
case *BulkOptionalField, *Ellipsis:
case *Field:
v.UpdateArcType(f.ArcType)
v.updateArcType(f.ArcType)
case *DynamicField:
v.UpdateArcType(f.ArcType)
v.updateArcType(f.ArcType)
default:
v.ArcType = ArcMember
}
Expand Down
2 changes: 1 addition & 1 deletion internal/core/adt/comprehension.go
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ func (n *nodeContext) injectComprehensions(allP *[]envYield, allowCycle bool, st

v := n.node
for c := d.leaf; c.parent != nil; c = c.parent {
v.UpdateArcType(c.arcType)
v.updateArcType(c.arcType)
v = c.arc
}

Expand Down
4 changes: 2 additions & 2 deletions internal/core/adt/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -520,9 +520,9 @@ func (c *OpContext) Validate(check Validator, value Value) *Bottom {
return err
}

// Concrete returns the concrete value of x after evaluating it.
// concrete returns the concrete value of x after evaluating it.
// msg is used to mention the context in which an error occurred, if any.
func (c *OpContext) Concrete(env *Environment, x Expr, msg interface{}) (result Value, complete bool) {
func (c *OpContext) concrete(env *Environment, x Expr, msg interface{}) (result Value, complete bool) {

w, complete := c.Evaluate(env, x)

Expand Down
4 changes: 2 additions & 2 deletions internal/core/adt/expr.go
Original file line number Diff line number Diff line change
Expand Up @@ -1277,8 +1277,8 @@ func (x *BinaryExpr) evaluate(c *OpContext, state vertexStatus) Value {
}
}

left, _ := c.Concrete(env, x.X, x.Op)
right, _ := c.Concrete(env, x.Y, x.Op)
left, _ := c.concrete(env, x.X, x.Op)
right, _ := c.concrete(env, x.Y, x.Op)

if err := CombineErrors(x.Src, left, right); err != nil {
return err
Expand Down

0 comments on commit ce65141

Please sign in to comment.