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

Method rule

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

Source from the content-addressed store, hash-verified

1018}
1019
1020common_peg_parser common_peg_parser_builder::rule(const std::string & name, const common_peg_parser & p, bool trigger) {
1021 auto clean_name = rule_name(name);
1022 auto rule_id = arena_.add_parser(common_peg_rule_parser{clean_name, p.id(), trigger});
1023 arena_.add_rule(clean_name, rule_id);
1024 return ref(clean_name);
1025}
1026
1027common_peg_parser common_peg_parser_builder::rule(const std::string & name, const std::function<common_peg_parser()> & builder_fn, bool trigger) {
1028 auto clean_name = rule_name(name);

Callers 9

test_example_nativeFunction · 0.45
test_example_qwen3_coderFunction · 0.45
test_basicFunction · 0.45
test_gbnf_generationFunction · 0.45
parse_ini_from_fileFunction · 0.45

Calls 5

rule_nameFunction · 0.85
add_parserMethod · 0.80
has_ruleMethod · 0.80
idMethod · 0.45
add_ruleMethod · 0.45

Tested by 5

test_example_nativeFunction · 0.36
test_example_qwen3_coderFunction · 0.36
test_basicFunction · 0.36
test_gbnf_generationFunction · 0.36