| 369 | } // namespace |
| 370 | |
| 371 | void Parser::Message(const std::string &msg) { |
| 372 | if (!error_.empty()) error_ += "\n"; // log all warnings and errors |
| 373 | error_ += file_being_parsed_.length() ? AbsolutePath(file_being_parsed_) : ""; |
| 374 | // clang-format off |
| 375 | |
| 376 | #ifdef _WIN32 // MSVC alike |
| 377 | error_ += |
| 378 | "(" + NumToString(line_) + ", " + NumToString(CursorPosition()) + ")"; |
| 379 | #else // gcc alike |
| 380 | if (file_being_parsed_.length()) error_ += ":"; |
| 381 | error_ += NumToString(line_) + ": " + NumToString(CursorPosition()); |
| 382 | #endif |
| 383 | // clang-format on |
| 384 | error_ += ": " + msg; |
| 385 | } |
| 386 | |
| 387 | void Parser::Warning(const std::string &msg) { |
| 388 | if (!opts.no_warnings) { |
no test coverage detected