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

Method Make

parser/macro.cc:433–448  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

431}
432
433absl::StatusOr<Macro> Macro::Make(absl::string_view name, size_t argument_count,
434 MacroExpander expander, bool receiver_style,
435 bool var_arg_style) {
436 if (!internal::LexisIsIdentifier(name)) {
437 return absl::InvalidArgumentError(absl::StrCat(
438 "macro function name `", name, "` is not a valid identifier"));
439 }
440 if (!expander) {
441 return absl::InvalidArgumentError(
442 absl::StrCat("macro expander for `", name, "` cannot be empty"));
443 }
444 return Macro(std::make_shared<Rep>(
445 std::string(name),
446 Key(name, argument_count, receiver_style, var_arg_style), argument_count,
447 std::move(expander), receiver_style, var_arg_style));
448}
449
450const Macro& HasMacro() {
451 static const absl::NoDestructor<Macro> macro(MakeHasMacro());

Callers

nothing calls this directly

Calls 2

LexisIsIdentifierFunction · 0.85
MacroClass · 0.85

Tested by

no test coverage detected