Worked on code for difference transmission

This commit is contained in:
2021-09-09 18:23:17 -04:00
parent bac1a7b876
commit aedd8ca43a
8 changed files with 456 additions and 403 deletions

View File

@@ -36,13 +36,13 @@ bool is_identifier(const std::string &str) {
}
void quote_string(const std::string &s, std::ostream *os) {
bool usesinglequote = false;
bool anysq = false;
bool anydq = false;
for (char c : s) {
if (c == '"') {
usesinglequote = true;
break;
}
if (c == '\'') anysq = true;
if (c == '"') anydq = true;
}
bool usesinglequote = (!anysq)||(anydq);
(*os) << (usesinglequote ? '\'' : '"');
for (char c : s) {
if (c >= 32) {