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

Method insert

subprojects/llama.cpp/common/peg-parser.cpp:124–138  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

122 }
123
124 void insert(const std::string & word) {
125 size_t current = 0;
126 for (unsigned char ch : word) {
127 auto it = nodes[current].children.find(ch);
128 if (it == nodes[current].children.end()) {
129 size_t child = create_node();
130 nodes[child].depth = nodes[current].depth + 1;
131 nodes[current].children[ch] = child;
132 current = child;
133 } else {
134 current = it->second;
135 }
136 }
137 nodes[current].is_word = true;
138 }
139};
140
141static std::pair<uint32_t, size_t> parse_hex_escape(const std::string & str, size_t pos, int hex_count) {

Callers 15

prependStdoutMethod · 0.45
prependStdoutLnMethod · 0.45
prependStderrMethod · 0.45
prependStderrLnMethod · 0.45
insertOrGetCategoryIdMethod · 0.45
insertTooltipMethod · 0.45
insertTooltipButtonMethod · 0.45
escapeBackticksMethod · 0.45

Calls 2

findMethod · 0.65
endMethod · 0.45

Tested by

no test coverage detected