| 109 | } |
| 110 | |
| 111 | static std::unique_ptr<llama_grammar> build_grammar(const std::string & grammar_str) { |
| 112 | return std::unique_ptr<llama_grammar>( |
| 113 | llama_grammar_init_impl(nullptr, grammar_str.c_str(), "root", false, nullptr, 0, nullptr, 0)); |
| 114 | } |
| 115 | |
| 116 | // TODO: extract to common helper (copied from test-grammar-integration.cpp) |
| 117 | static bool match_string(const std::string & input, llama_grammar * grammar) { |
no test coverage detected