| 127 | } |
| 128 | |
| 129 | void Parser::Message(const std::string &msg) { |
| 130 | if (!error_.empty()) error_ += "\n"; // log all warnings and errors |
| 131 | error_ += file_being_parsed_.length() ? AbsolutePath(file_being_parsed_) : ""; |
| 132 | // clang-format off |
| 133 | |
| 134 | #ifdef _WIN32 // MSVC alike |
| 135 | error_ += |
| 136 | "(" + NumToString(line_) + ", " + NumToString(CursorPosition()) + ")"; |
| 137 | #else // gcc alike |
| 138 | if (file_being_parsed_.length()) error_ += ":"; |
| 139 | error_ += NumToString(line_) + ": " + NumToString(CursorPosition()); |
| 140 | #endif |
| 141 | // clang-format on |
| 142 | error_ += ": " + msg; |
| 143 | } |
| 144 | |
| 145 | void Parser::Warning(const std::string &msg) { |
| 146 | if (!opts.no_warnings) Message("warning: " + msg); |
nothing calls this directly
no test coverage detected