collapse internal whitespace to single blanks (for keyword matching)
| 37 | |
| 38 | // collapse internal whitespace to single blanks (for keyword matching) |
| 39 | static string CollapseWS (const string & s) |
| 40 | { |
| 41 | string out; |
| 42 | bool inws = false; |
| 43 | for (char c : s) |
| 44 | { |
| 45 | if (c == ' ' || c == '\t') { inws = true; continue; } |
| 46 | if (inws && !out.empty()) out += ' '; |
| 47 | inws = false; |
| 48 | out += c; |
| 49 | } |
| 50 | return out; |
| 51 | } |
| 52 | |
| 53 | static vector<string> SplitComma (const string & line) |
| 54 | { |