| 183 | } |
| 184 | |
| 185 | absl::Status Unparser::VisitConst(const Constant& expr) { |
| 186 | switch (expr.constant_kind_case()) { |
| 187 | case Constant::kStringValue: |
| 188 | Print( |
| 189 | cel::internal::FormatDoubleQuotedStringLiteral(expr.string_value())); |
| 190 | break; |
| 191 | case Constant::kInt64Value: |
| 192 | Print(expr.int64_value()); |
| 193 | break; |
| 194 | case Constant::kUint64Value: |
| 195 | Print(expr.uint64_value(), "u"); |
| 196 | break; |
| 197 | case Constant::kBoolValue: |
| 198 | Print(expr.bool_value() ? "true" : "false"); |
| 199 | break; |
| 200 | case Constant::kDoubleValue: |
| 201 | Print(expr.double_value()); |
| 202 | break; |
| 203 | case Constant::kNullValue: |
| 204 | Print("null"); |
| 205 | break; |
| 206 | case Constant::kBytesValue: |
| 207 | Print(cel::internal::FormatDoubleQuotedBytesLiteral(expr.bytes_value())); |
| 208 | break; |
| 209 | default: |
| 210 | return absl::InvalidArgumentError(absl::StrCat( |
| 211 | "Unsupported Constant kind: ", expr.constant_kind_case())); |
| 212 | } |
| 213 | return absl::OkStatus(); |
| 214 | } |
| 215 | |
| 216 | absl::Status Unparser::VisitIdent(const Expr::Ident& expr) { |
| 217 | Print(expr.name()); |
nothing calls this directly
no test coverage detected