| 126 | } |
| 127 | |
| 128 | absl::Status AddSignednessDecls(TypeCheckerBuilder& builder) { |
| 129 | const Type kNumerics[] = {IntType(), DoubleType(), UintType()}; |
| 130 | |
| 131 | FunctionDecl sign_decl; |
| 132 | sign_decl.set_name("math.sign"); |
| 133 | |
| 134 | FunctionDecl abs_decl; |
| 135 | abs_decl.set_name("math.abs"); |
| 136 | |
| 137 | for (const Type& type : kNumerics) { |
| 138 | CEL_RETURN_IF_ERROR(sign_decl.AddOverload(MakeOverloadDecl( |
| 139 | absl::StrCat("math_sign_", OverloadTypeName(type)), type, type))); |
| 140 | CEL_RETURN_IF_ERROR(abs_decl.AddOverload(MakeOverloadDecl( |
| 141 | absl::StrCat("math_abs_", OverloadTypeName(type)), type, type))); |
| 142 | } |
| 143 | |
| 144 | CEL_RETURN_IF_ERROR(builder.AddFunction(sign_decl)); |
| 145 | CEL_RETURN_IF_ERROR(builder.AddFunction(abs_decl)); |
| 146 | |
| 147 | return absl::OkStatus(); |
| 148 | } |
| 149 | |
| 150 | absl::Status AddSqrtDecls(TypeCheckerBuilder& builder) { |
| 151 | const Type kNumerics[] = {IntType(), DoubleType(), UintType()}; |
no test coverage detected