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

Function ParseMacroList

env/env_yaml.cc:216–236  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

214}
215
216absl::StatusOr<absl::flat_hash_set<std::string>> ParseMacroList(
217 absl::string_view yaml, const YAML::Node& standard_library,
218 absl::string_view key) {
219 absl::flat_hash_set<std::string> macro_set;
220 const YAML::Node macros = standard_library[std::string(key)];
221 if (!macros.IsDefined()) {
222 return macro_set;
223 }
224 if (!macros.IsSequence()) {
225 return YamlError(yaml, macros,
226 absl::StrCat("Node '", key, "' is not a sequence"));
227 }
228 for (const YAML::Node& macro : macros) {
229 if (!macro.IsScalar()) {
230 return YamlError(yaml, macro,
231 absl::StrCat("Entry in '", key, "' is not a string"));
232 }
233 macro_set.insert(GetString(yaml, macro));
234 }
235 return macro_set;
236}
237
238absl::StatusOr<absl::flat_hash_set<std::pair<std::string, std::string>>>
239ParseFunctionList(absl::string_view yaml, const YAML::Node& standard_library,

Callers 1

Calls 2

YamlErrorFunction · 0.85
GetStringFunction · 0.85

Tested by

no test coverage detected