MCPcopy Create free account
hub / github.com/FastFlowLM/FastFlowLM / do_render

Method do_render

src/include/minja/minja.hpp:921–931  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

919public:
920 ExpressionNode(const Location & loc, std::shared_ptr<Expression> && e) : TemplateNode(loc), expr(std::move(e)) {}
921 void do_render(std::ostringstream & out, const std::shared_ptr<Context> & context) const override {
922 if (!expr) throw std::runtime_error("ExpressionNode.expr is null");
923 auto result = expr->evaluate(context);
924 if (result.is_string()) {
925 out << result.get<std::string>();
926 } else if (result.is_boolean()) {
927 out << (result.get<bool>() ? "True" : "False");
928 } else if (!result.is_null()) {
929 out << result.dump();
930 }
931 }
932};
933
934class IfNode : public TemplateNode {

Callers

nothing calls this directly

Calls 5

is_stringMethod · 0.80
is_booleanMethod · 0.80
is_nullMethod · 0.80
evaluateMethod · 0.45
dumpMethod · 0.45

Tested by

no test coverage detected