| 343 | } |
| 344 | |
| 345 | void Check(const std::string& prv, const std::string& pub, const std::string& norm_prv, const std::string& norm_pub, int flags, const std::vector<std::vector<std::string>>& scripts, const std::optional<OutputType>& type, const std::set<std::vector<uint32_t>>& paths = ONLY_EMPTY) |
| 346 | { |
| 347 | bool found_apostrophes_in_prv = false; |
| 348 | bool found_apostrophes_in_pub = false; |
| 349 | |
| 350 | // Do not replace apostrophes with 'h' in prv and pub |
| 351 | DoCheck(prv, pub, norm_prv, norm_pub, flags, scripts, type, paths); |
| 352 | |
| 353 | // Replace apostrophes with 'h' in prv but not in pub, if apostrophes are found in prv |
| 354 | if (prv.find('\'') != std::string::npos) { |
| 355 | found_apostrophes_in_prv = true; |
| 356 | DoCheck(prv, pub, norm_prv, norm_pub, flags, scripts, type, paths, /* replace_apostrophe_with_h_in_prv = */true, /*replace_apostrophe_with_h_in_pub = */false); |
| 357 | } |
| 358 | |
| 359 | // Replace apostrophes with 'h' in pub but not in prv, if apostrophes are found in pub |
| 360 | if (pub.find('\'') != std::string::npos) { |
| 361 | found_apostrophes_in_pub = true; |
| 362 | DoCheck(prv, pub, norm_prv, norm_pub, flags, scripts, type, paths, /* replace_apostrophe_with_h_in_prv = */false, /*replace_apostrophe_with_h_in_pub = */true); |
| 363 | } |
| 364 | |
| 365 | // Replace apostrophes with 'h' both in prv and in pub, if apostrophes are found in both |
| 366 | if (found_apostrophes_in_prv && found_apostrophes_in_pub) { |
| 367 | DoCheck(prv, pub, norm_prv, norm_pub, flags, scripts, type, paths, /* replace_apostrophe_with_h_in_prv = */true, /*replace_apostrophe_with_h_in_pub = */true); |
| 368 | } |
| 369 | } |
| 370 | |
| 371 | } |
| 372 |
no test coverage detected