MCPcopy Create free account
hub / github.com/antirez/llama.cpp-deepseek-v4-flash / format_codepoint

Function format_codepoint

tests/test-chat.cpp:130–142  ·  view source on GitHub ↗

Helper to format a code point as a readable string

Source from the content-addressed store, hash-verified

128
129// Helper to format a code point as a readable string
130static std::string format_codepoint(uint32_t cp) {
131 if (cp >= 32 && cp < 127) {
132 return std::string("'") + static_cast<char>(cp) + "'";
133 } else if (cp == '\n') {
134 return "'\\n'";
135 } else if (cp == '\r') {
136 return "'\\r'";
137 } else if (cp == '\t') {
138 return "'\\t'";
139 } else {
140 return "U+" + std::to_string(cp);
141 }
142}
143
144// Helper to format expected element from grammar stack
145static std::string format_expected_element(const llama_grammar_rules & /* rules*/, const llama_grammar_element * elem) {

Callers 2

format_expected_elementFunction · 0.85
match_string_detailedFunction · 0.85

Calls 2

stringClass · 0.85
to_stringFunction · 0.50

Tested by

no test coverage detected