True when `prev` and `tok` touched in the source text: same file and line, `prev` ending exactly where `tok` starts (simplecpp's own adjacency test), and neither produced by a macro expansion (expansion tokens carry the call site's location, so their columns prove nothing).
| 386 | // and neither produced by a macro expansion (expansion tokens carry the call |
| 387 | // site's location, so their columns prove nothing). |
| 388 | static bool tokens_source_adjacent(const simplecpp::Token *prev, const simplecpp::Token *tok) { |
| 389 | if (!prev->macro.empty() || !tok->macro.empty() || !prev->location.sameline(tok->location)) { |
| 390 | return false; |
| 391 | } |
| 392 | const std::string &s = prev->str(); |
| 393 | if (s.find_first_of("\r\n") != std::string::npos) { |
| 394 | return false; |
| 395 | } |
| 396 | return prev->location.col + s.size() == tok->location.col; |
| 397 | } |
| 398 | |
| 399 | // The expanded buffer in the source's own spelling. Mirrors |
| 400 | // simplecpp::TokenList::stringify() line for line — the same newlines and |
no test coverage detected