From 8d8030142e57bec1d69dd7e128ba864528cef954 Mon Sep 17 00:00:00 2001 From: Xuan Son Nguyen Date: Thu, 25 Dec 2025 00:19:23 +0100 Subject: [PATCH] jinja vm --- common/jinja/jinja-vm.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 common/jinja/jinja-vm.cpp diff --git a/common/jinja/jinja-vm.cpp b/common/jinja/jinja-vm.cpp new file mode 100644 index 0000000000..7c8d0cf732 --- /dev/null +++ b/common/jinja/jinja-vm.cpp @@ -0,0 +1,28 @@ +#include +#include + +struct vm_context { + std::ostringstream out; +}; + +struct op_base { + virtual ~op_base() = default; + virtual void execute(vm_context & ctx) = 0; +}; + +struct op_print : public op_base { + std::string message; + op_print(const std::string & message) : message(message) {} + void execute(vm_context & ctx) override { + ctx.out << message; + } +}; + +struct op_load : public op_base { + std::string dst; + std::string src; + std::string value; + op_load(const std::string & dst) : dst(dst) {} + void execute(vm_context & ctx) override { + } +};