MCPcopy Create free account
hub / github.com/cel-expr/cel-go / Resolve

Method Resolve

interpreter/attributes.go:615–636  ·  view source on GitHub ↗

Resolve expression value and qualifier relative to the expression result.

(vars Activation)

Source from the content-addressed store, hash-verified

613
614// Resolve expression value and qualifier relative to the expression result.
615func (a *relativeAttribute) Resolve(vars Activation) (any, error) {
616 // First, evaluate the operand.
617 v := a.operand.Eval(vars)
618 if types.IsError(v) {
619 return nil, v.(*types.Err)
620 }
621 if types.IsUnknown(v) {
622 return v, nil
623 }
624 obj, isOpt, err := applyQualifiers(vars, v, a.qualifiers)
625 if err != nil {
626 return nil, err
627 }
628 if isOpt {
629 val := a.adapter.NativeToValue(obj)
630 if types.IsUnknown(val) {
631 return val, nil
632 }
633 return types.OptionalOf(val), nil
634 }
635 return obj, nil
636}
637
638// String is an implementation of the Stringer interface method.
639func (a *relativeAttribute) String() string {

Callers

nothing calls this directly

Calls 6

IsErrorFunction · 0.92
IsUnknownFunction · 0.92
OptionalOfFunction · 0.92
applyQualifiersFunction · 0.85
EvalMethod · 0.65
NativeToValueMethod · 0.65

Tested by

no test coverage detected