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

Method choice

common/peg-parser.cpp:1189–1201  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1187}
1188
1189common_peg_parser common_peg_parser_builder::choice(const std::vector<common_peg_parser_id> & parsers) {
1190 // Flatten nested choices
1191 std::vector<common_peg_parser_id> flattened;
1192 for (const auto & p : parsers) {
1193 const auto & parser = arena_.get(p);
1194 if (auto choice = std::get_if<common_peg_choice_parser>(&parser)) {
1195 flattened.insert(flattened.end(), choice->children.begin(), choice->children.end());
1196 } else {
1197 flattened.push_back(p);
1198 }
1199 }
1200 return wrap(arena_.add_parser(common_peg_choice_parser{flattened}));
1201}
1202
1203common_peg_parser common_peg_parser_builder::choice(const std::vector<common_peg_parser> & parsers) {
1204 std::vector<common_peg_parser_id> ids;

Callers 15

test_example_qwen3_coderFunction · 0.45
test_tagged_peg_parserFunction · 0.45
generator_random_charsFunction · 0.45
test_python_dict_parserFunction · 0.45
build_parserMethod · 0.45
peg-parser.cppFile · 0.45
operator|Method · 0.45

Calls 8

endMethod · 0.80
add_parserMethod · 0.80
getMethod · 0.45
insertMethod · 0.45
beginMethod · 0.45
push_backMethod · 0.45
sizeMethod · 0.45
idMethod · 0.45

Tested by 7

test_example_qwen3_coderFunction · 0.36
test_tagged_peg_parserFunction · 0.36
generator_random_charsFunction · 0.36
test_python_dict_parserFunction · 0.36