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

Method sequence

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

Source from the content-addressed store, hash-verified

945common_peg_parser_builder::common_peg_parser_builder() {}
946
947common_peg_parser common_peg_parser_builder::sequence(const std::vector<common_peg_parser_id> & parsers) {
948 // Flatten nested sequences
949 std::vector<common_peg_parser_id> flattened;
950 for (const auto & p : parsers) {
951 const auto & parser = arena_.get(p);
952 if (auto seq = std::get_if<common_peg_sequence_parser>(&parser)) {
953 flattened.insert(flattened.end(), seq->children.begin(), seq->children.end());
954 } else {
955 flattened.push_back(p);
956 }
957 }
958 return wrap(arena_.add_parser(common_peg_sequence_parser{flattened}));
959}
960
961common_peg_parser common_peg_parser_builder::sequence(const std::vector<common_peg_parser> & parsers) {
962 std::vector<common_peg_parser_id> ids;

Callers 8

test_example_nativeFunction · 0.45
test_example_qwen3_coderFunction · 0.45
test_unicodeFunction · 0.45
peg-parser.cppFile · 0.45
operator+Method · 0.45
operator<<Method · 0.45

Calls 8

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

Tested by 3

test_example_nativeFunction · 0.36
test_example_qwen3_coderFunction · 0.36
test_unicodeFunction · 0.36