| 989 | } |
| 990 | |
| 991 | static std::string simplecppErrToId(simplecpp::Output::Type type) |
| 992 | { |
| 993 | switch (type) { |
| 994 | case simplecpp::Output::ERROR: |
| 995 | return "preprocessorErrorDirective"; |
| 996 | case simplecpp::Output::SYNTAX_ERROR: |
| 997 | return "syntaxError"; |
| 998 | case simplecpp::Output::UNHANDLED_CHAR_ERROR: |
| 999 | return "unhandledChar"; |
| 1000 | case simplecpp::Output::INCLUDE_NESTED_TOO_DEEPLY: |
| 1001 | return "includeNestedTooDeeply"; |
| 1002 | case simplecpp::Output::FILE_NOT_FOUND: |
| 1003 | return "missingFile"; |
| 1004 | case simplecpp::Output::EXPLICIT_INCLUDE_NOT_FOUND: |
| 1005 | return "missingIncludeExplicit"; |
| 1006 | // should never occur |
| 1007 | case simplecpp::Output::DUI_ERROR: |
| 1008 | // handled separately |
| 1009 | case simplecpp::Output::MISSING_HEADER: |
| 1010 | // no handled at all (warnings) |
| 1011 | case simplecpp::Output::WARNING: |
| 1012 | case simplecpp::Output::PORTABILITY_BACKSLASH: |
| 1013 | throw std::runtime_error("unexpected simplecpp::Output type " + std::to_string(type)); |
| 1014 | } |
| 1015 | |
| 1016 | cppcheck::unreachable(); |
| 1017 | } |
| 1018 | |
| 1019 | void Preprocessor::error(const simplecpp::Location& loc, const std::string &msg, simplecpp::Output::Type type) |
| 1020 | { |