| 1760 | } |
| 1761 | |
| 1762 | absl::Status AddLibrarySubset(cel::ParserLibrarySubset subset) override { |
| 1763 | if (subset.library_id.empty()) { |
| 1764 | return absl::InvalidArgumentError("subset must have a library id"); |
| 1765 | } |
| 1766 | std::string library_id = subset.library_id; |
| 1767 | auto [it, inserted] = |
| 1768 | library_subsets_.insert({library_id, std::move(subset)}); |
| 1769 | if (!inserted) { |
| 1770 | return absl::AlreadyExistsError( |
| 1771 | absl::StrCat("parser library subset already exists: ", library_id)); |
| 1772 | } |
| 1773 | return absl::OkStatus(); |
| 1774 | } |
| 1775 | |
| 1776 | absl::StatusOr<std::unique_ptr<cel::Parser>> Build() override { |
| 1777 | using std::swap; |
no test coverage detected