| 51 | } |
| 52 | |
| 53 | void TYandexConfig::ReportError(const char* ptr, const char* err, bool warning) { |
| 54 | if (ptr) { |
| 55 | char buf[1024]; |
| 56 | int line = 0, col = 0; |
| 57 | if (!EndLines.empty()) { |
| 58 | TVector<const char*>::iterator I = UpperBound(EndLines.begin(), EndLines.end(), ptr); |
| 59 | if (I == EndLines.end()) |
| 60 | I = EndLines.end() - 1; |
| 61 | line = int(I - EndLines.begin()); |
| 62 | if (line) |
| 63 | I--; |
| 64 | col = int(ptr - (*I)); |
| 65 | } |
| 66 | if (warning) |
| 67 | snprintf(buf, 1024, "Warning at line %d, col %d: %s.\n", line, col, err); |
| 68 | else |
| 69 | snprintf(buf, 1024, "Error at line %d, col %d: %s.\n", line, col, err); |
| 70 | Errors.push_back(buf); |
| 71 | } else |
| 72 | Errors.push_back(err); |
| 73 | } |
| 74 | |
| 75 | void TYandexConfig::ReportError(const char* ptr, bool warning, const char* format, ...) { |
| 76 | va_list args; |
nothing calls this directly
no test coverage detected