diff --git a/src/lib/text-template.hpp b/src/lib/text-template.hpp index 6529229af..ef4307298 100644 --- a/src/lib/text-template.hpp +++ b/src/lib/text-template.hpp @@ -75,23 +75,39 @@ namespace lib { TEXT, KEY, COND, JUMP, ITER, LOOP }; + /** cross-references by index number */ + using Idx = size_t; + struct ParseCtx { Clause clause; + Idx begin{0}; + Idx after{0}; }; struct Action { - Code code; - string val; + Code code{TEXT}; + string val{""}; + Idx refIDX{0}; + + template + string instantiate (IT&); }; - template - struct Instance + /** Binding to a specific data source. + * @note requires partial specialisation */ + template + struct InstanceCore { - + static_assert (not sizeof(DAT), + "unable to bind this data source " + "for TextTemplate instantiation"); }; + /** the text template is compiled into a sequence of Actions */ + using ActionSeq = std::vector; + using PipeTODO = std::vector; using InstanceIter = decltype (explore (std::declval())); diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index 8ce262d16..4a9bc919f 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -112670,6 +112670,12 @@ std::cout << tmpl.render({"what", "World"}) << s + + + + + + @@ -112815,6 +112821,35 @@ std::cout << tmpl.render({"what", "World"}) << s + + + + + + + + + + + + + + + + + + + + + + + + + + + + +