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

Function RegisterRegexDecls

extensions/regex_functions.cc:188–212  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

186}
187
188absl::Status RegisterRegexDecls(TypeCheckerBuilder& builder) {
189 CEL_ASSIGN_OR_RETURN(
190 FunctionDecl regex_extract_decl,
191 MakeFunctionDecl(
192 std::string(kRegexExtract),
193 MakeOverloadDecl("re_extract_string_string_string", StringType(),
194 StringType(), StringType(), StringType())));
195 CEL_RETURN_IF_ERROR(builder.AddFunction(regex_extract_decl));
196
197 CEL_ASSIGN_OR_RETURN(
198 FunctionDecl regex_capture_decl,
199 MakeFunctionDecl(
200 std::string(kRegexCapture),
201 MakeOverloadDecl("re_capture_string_string", StringType(),
202 StringType(), StringType())));
203 CEL_RETURN_IF_ERROR(builder.AddFunction(regex_capture_decl));
204
205 CEL_ASSIGN_OR_RETURN(
206 FunctionDecl regex_capture_n_decl,
207 MakeFunctionDecl(
208 std::string(kRegexCaptureN),
209 MakeOverloadDecl("re_captureN_string_string", CaptureNMapType(),
210 StringType(), StringType())));
211 return builder.AddFunction(regex_capture_n_decl);
212}
213
214} // namespace
215

Callers

nothing calls this directly

Calls 1

AddFunctionMethod · 0.45

Tested by

no test coverage detected