MCPcopy Create free account
hub / github.com/cel-expr/cel-cpp / LookupIdent

Function LookupIdent

eval/eval/ident_step.cc:41–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39};
40
41absl::Status LookupIdent(absl::string_view name, ExecutionFrameBase& frame,
42 Value& result, AttributeTrail& attribute) {
43 if (frame.attribute_tracking_enabled()) {
44 attribute = AttributeTrail(std::string(name));
45 if (frame.missing_attribute_errors_enabled() &&
46 frame.attribute_utility().CheckForMissingAttribute(attribute)) {
47 CEL_ASSIGN_OR_RETURN(
48 result, frame.attribute_utility().CreateMissingAttributeError(
49 attribute.attribute()));
50 return absl::OkStatus();
51 }
52 if (frame.unknown_processing_enabled() &&
53 frame.attribute_utility().CheckForUnknownExact(attribute)) {
54 result =
55 frame.attribute_utility().CreateUnknownSet(attribute.attribute());
56 return absl::OkStatus();
57 }
58 }
59
60 CEL_ASSIGN_OR_RETURN(
61 auto found, frame.activation().FindVariable(name, frame.descriptor_pool(),
62 frame.message_factory(),
63 frame.arena(), &result));
64
65 if (found) {
66 return absl::OkStatus();
67 }
68
69 result = cel::ErrorValue(CreateError(
70 absl::StrCat("No value with name \"", name, "\" found in Activation")));
71
72 return absl::OkStatus();
73}
74
75absl::Status IdentStep::Evaluate(ExecutionFrame* frame) const {
76 Value value;

Callers 2

EvaluateMethod · 0.85
EvaluateMethod · 0.85

Calls 12

AttributeTrailClass · 0.85
ErrorValueFunction · 0.85
attributeMethod · 0.80
CheckForUnknownExactMethod · 0.80
CEL_ASSIGN_OR_RETURNFunction · 0.70
CreateErrorFunction · 0.50
CreateUnknownSetMethod · 0.45

Tested by

no test coverage detected