Skip to content

Commit 0ec1b3e

Browse files
mpvlcueckoo
authored andcommitted
internal/core/adt: rename CallContext.Expr
Rename it to Arg to be more consistent with naming and to free up Expr for actually getting the corresponding expression. Signed-off-by: Marcel van Lohuizen <[email protected]> Change-Id: If5b71be2ca364ecfb98ee221f5d989bb3f4e2241 Dispatch-Trailer: {"type":"trybot","CL":1217234,"patchset":4,"ref":"refs/changes/34/1217234/4","targetBranch":"master"}
1 parent 2d506a0 commit 0ec1b3e

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

internal/core/adt/call.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,13 @@ func (c *CallContext) Args() []Value {
6969
return c.args
7070
}
7171

72-
// Expr returns the nth argument expression. The value is evaluated and any
72+
// Arg returns the nth argument expression. The value is evaluated and any
7373
// cycle information is accumulated in the context. This allows cycles in
7474
// arguments to be detected.
7575
//
7676
// This method of getting an argument should be used when the argument is used
7777
// as a schema and may contain cycles.
78-
func (c *CallContext) Expr(i int) Value {
78+
func (c *CallContext) Arg(i int) Value {
7979
// If the call context represents a validator call, the argument will be
8080
// offset by 1.
8181
if c.isValidator {

internal/core/compile/builtin.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ var andBuiltin = &adt.Builtin{
118118
Result: adt.IntKind,
119119
RawFunc: func(call *adt.CallContext) adt.Value {
120120
c := call.OpContext()
121-
arg := call.Expr(0)
121+
arg := call.Arg(0)
122122

123123
list := c.RawElems(arg)
124124
if len(list) == 0 {

internal/pkg/context.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ func (c *CallCtxt) Do() bool {
5656
// However, this only makes sense if functions also use the same OpContext for
5757
// further evaluation. We should enforce as we port the old calls.
5858
func (c *CallCtxt) Schema(i int) Schema {
59-
v := c.Expr(i)
59+
v := c.Arg(i)
6060
return value.Make(c.ctx, v)
6161
}
6262

0 commit comments

Comments
 (0)