| 203 | |
| 204 | |
| 205 | std::string getLexicalErrorMessage( |
| 206 | const char * begin, |
| 207 | const char * end, |
| 208 | Token last_token, |
| 209 | bool hilite, |
| 210 | const std::string & query_description) |
| 211 | { |
| 212 | WriteBufferFromOwnString out; |
| 213 | writeCommonErrorMessage(out, begin, end, last_token, query_description); |
| 214 | writeQueryAroundTheError(out, begin, end, hilite, &last_token, 1); |
| 215 | |
| 216 | out << getErrorTokenDescription(last_token.type); |
| 217 | if (last_token.size()) |
| 218 | { |
| 219 | out << ": '" << StringRef{last_token.begin, last_token.size()} << "'"; |
| 220 | } |
| 221 | |
| 222 | return out.str(); |
| 223 | } |
| 224 | |
| 225 | |
| 226 | std::string getUnmatchedParenthesesErrorMessage( |
no test coverage detected