| 52 | } // namespace |
| 53 | |
| 54 | absl::Status EnableRegexPrecompilation(RuntimeBuilder& builder) { |
| 55 | CEL_ASSIGN_OR_RETURN(RuntimeImpl * runtime_impl, |
| 56 | RuntimeImplFromBuilder(builder)); |
| 57 | ABSL_ASSERT(runtime_impl != nullptr); |
| 58 | |
| 59 | runtime_impl->expr_builder().AddProgramOptimizer( |
| 60 | CreateRegexPrecompilationExtension( |
| 61 | runtime_impl->expr_builder().options().regex_max_program_size)); |
| 62 | return absl::OkStatus(); |
| 63 | } |
| 64 | |
| 65 | } // namespace cel::extensions |