internal/core/adt: preparatory work for user-defined functions
When introducing user-callable functions, we want to make
a break with the past and not support some of the modes that
the current builtin function calls support (like, for example,
we want a clear distinction between functions and validators).
In order to do that, the plan is to introduce a new `adt.Func` type
to implement the new semantics rather than complicate the
already complex `adt.Builtin` logic. That means that we want the
`CallExpr` logic to be independent of the `Builtin` logic, but they
are both somewhat intertwined currently.
Factor out `Builtin.rawCall` from `CallExpr.evaluate` in order to
separate the two some more, and also rename `CallContext` to
`BuiltinCallContext` make it clear that the type is about Builtin
calls - we will use a different API for `adt.Func`.
This should have no semantic effect at all.
Signed-off-by: Roger Peppe <rogpeppe@gmail.com>
Change-Id: I2d33b14a8cf5c431dd70cc7a9e14930ba43d807f
Reviewed-on: https://cue.gerrithub.io/c/cue-lang/cue/+/1232332
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>