| 945 | } |
| 946 | |
| 947 | std::string Reader::getFormattedErrorMessages() const { |
| 948 | std::string formattedMessage; |
| 949 | for (const auto& error : errors_) { |
| 950 | formattedMessage += |
| 951 | "* " + getLocationLineAndColumn(error.token_.start_) + "\n"; |
| 952 | formattedMessage += " " + error.message_ + "\n"; |
| 953 | if (error.extra_) |
| 954 | formattedMessage += |
| 955 | "See " + getLocationLineAndColumn(error.extra_) + " for detail.\n"; |
| 956 | } |
| 957 | return formattedMessage; |
| 958 | } |
| 959 | |
| 960 | // Reader |
| 961 | ///////////////////////// |