| 650 | } |
| 651 | |
| 652 | absl::Status AddStringFunctions(TypeCheckerBuilder& builder) { |
| 653 | FunctionDecl contains; |
| 654 | contains.set_name(StandardFunctions::kStringContains); |
| 655 | CEL_RETURN_IF_ERROR(contains.AddOverload( |
| 656 | MakeMemberOverloadDecl(StandardOverloadIds::kContainsString, BoolType(), |
| 657 | StringType(), StringType()))); |
| 658 | CEL_RETURN_IF_ERROR(builder.AddFunction(std::move(contains))); |
| 659 | |
| 660 | FunctionDecl starts_with; |
| 661 | starts_with.set_name(StandardFunctions::kStringStartsWith); |
| 662 | CEL_RETURN_IF_ERROR(starts_with.AddOverload( |
| 663 | MakeMemberOverloadDecl(StandardOverloadIds::kStartsWithString, BoolType(), |
| 664 | StringType(), StringType()))); |
| 665 | CEL_RETURN_IF_ERROR(builder.AddFunction(std::move(starts_with))); |
| 666 | |
| 667 | FunctionDecl ends_with; |
| 668 | ends_with.set_name(StandardFunctions::kStringEndsWith); |
| 669 | CEL_RETURN_IF_ERROR(ends_with.AddOverload( |
| 670 | MakeMemberOverloadDecl(StandardOverloadIds::kEndsWithString, BoolType(), |
| 671 | StringType(), StringType()))); |
| 672 | CEL_RETURN_IF_ERROR(builder.AddFunction(std::move(ends_with))); |
| 673 | |
| 674 | return absl::OkStatus(); |
| 675 | } |
| 676 | |
| 677 | absl::Status AddRegexFunctions(TypeCheckerBuilder& builder) { |
| 678 | FunctionDecl matches; |
no test coverage detected