Validate that a non-loop CIF key has only a single value

PiperOrigin-RevId: 802455341
Change-Id: I089c4e0a9a52862b5eba6d26023184a4a34efc96
This commit is contained in:
Augustin Zidek
2025-09-03 01:47:50 -07:00
committed by Copybara-Service
parent 7b816f4035
commit 0ea324ce74

View File

@ -443,6 +443,10 @@ absl::StatusOr<CifDict> CifDict::FromString(absl::string_view cif_string) {
}
if (key.empty()) {
key = token;
if (!absl::StartsWith(key, "_")) {
return absl::InvalidArgumentError(
absl::StrCat("Key '", key, "' does not start with an underscore."));
}
} else {
cif[key].emplace_back(token);
key = "";