From b333b06772c89d96aacb5490d6a219fba7c09cc6 Mon Sep 17 00:00:00 2001 From: Mitja Felicijan Date: Thu, 12 Feb 2026 20:57:17 +0100 Subject: Engage! --- llama.cpp/common/jinja/parser.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 llama.cpp/common/jinja/parser.h (limited to 'llama.cpp/common/jinja/parser.h') diff --git a/llama.cpp/common/jinja/parser.h b/llama.cpp/common/jinja/parser.h new file mode 100644 index 0000000..f1cc021 --- /dev/null +++ b/llama.cpp/common/jinja/parser.h @@ -0,0 +1,21 @@ +#pragma once + +#include "lexer.h" +#include "runtime.h" +#include "utils.h" + +#include +#include + +namespace jinja { + +// parse from a list of tokens into an AST (program) +// may throw parser_exception on error +program parse_from_tokens(const lexer_result & lexer_res); + +struct parser_exception : public std::runtime_error { + parser_exception(const std::string & msg, const std::string & source, size_t pos) + : std::runtime_error(fmt_error_with_source("parser", msg, source, pos)) {} +}; + +} // namespace jinja -- cgit v1.2.3