MCPcopy Create free account
hub / github.com/appdevforall/CodeOnTheGo / get_line_col

Function get_line_col

subprojects/llama.cpp/common/jinja/runtime.cpp:33–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31}
32
33static std::string get_line_col(const std::string & source, size_t pos) {
34 size_t line = 1;
35 size_t col = 1;
36 for (size_t i = 0; i < pos && i < source.size(); i++) {
37 if (source[i] == '\n') {
38 line++;
39 col = 1;
40 } else {
41 col++;
42 }
43 }
44 return "line " + std::to_string(line) + ", column " + std::to_string(col);
45}
46
47static void ensure_key_type_allowed(const value & val) {
48 if (!val->is_hashable()) {

Callers 1

executeMethod · 0.85

Calls 2

to_stringFunction · 0.85
sizeMethod · 0.65

Tested by

no test coverage detected