| 295 | } |
| 296 | |
| 297 | static bool is_char_element(llama_grammar_element elem) { |
| 298 | switch (elem.type) { |
| 299 | case LLAMA_GRETYPE_CHAR: return true; |
| 300 | case LLAMA_GRETYPE_CHAR_NOT: return true; |
| 301 | case LLAMA_GRETYPE_CHAR_ALT: return true; |
| 302 | case LLAMA_GRETYPE_CHAR_RNG_UPPER: return true; |
| 303 | default: return false; |
| 304 | } |
| 305 | } |
| 306 | |
| 307 | static void print_rule_binary(FILE * file, const std::vector<llama_grammar_element> & rule) { |
| 308 | for (auto elem : rule) { |