Improve comments in CifDict

PiperOrigin-RevId: 791623617
Change-Id: I569b0c65d427f32bbb6a6e50a4791cb774347375
This commit is contained in:
Augustin Zidek
2025-08-06 04:04:43 -07:00
committed by Copybara-Service
parent 722437b4ff
commit 563896c75c

View File

@ -150,8 +150,9 @@ absl::StatusOr<std::vector<absl::string_view>> TokenizeInternal(
return tokens;
}
// Returns whether the token doesn't need any quoting. This is true if the token
// isn't empty and contains only safe characters [A-Za-z0-9.?-].
bool IsTrivialToken(const absl::string_view value) {
// Returns true if the token doesn't need any quoting and isn't multiline.
if (value.empty()) {
return false;
}
@ -161,8 +162,9 @@ bool IsTrivialToken(const absl::string_view value) {
});
}
// Returns whether the token needs to be a multiline token. This happens if it
// has a newline or both single and double quotes.
bool IsMultiLineToken(const absl::string_view value) {
// A token is multiline if it has a newline or both single and double quotes.
bool has_single_quotes = false;
bool has_double_quotes = false;
for (const char c : value) {