MCPcopy Create free account
hub / github.com/ByConity/ByConity / getLineAndCol

Function getLineAndCol

src/Parsers/parseQuery.cpp:52–65  ·  view source on GitHub ↗

From position in (possible multiline) query, get line number and column number in line. * Used in syntax error message. */

Source from the content-addressed store, hash-verified

50 * Used in syntax error message.
51 */
52std::pair<size_t, size_t> getLineAndCol(const char * begin, const char * pos)
53{
54 size_t line = 0;
55
56 const char * nl;
57 while ((nl = find_first_symbols<'\n'>(begin, pos)) < pos)
58 {
59 ++line;
60 begin = nl + 1;
61 }
62
63 /// Lines numbered from 1.
64 return { line + 1, pos - begin + 1 };
65}
66
67
68WriteBuffer & operator<< (WriteBuffer & out, const Expected & expected)

Callers 1

writeCommonErrorMessageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected