From d2ac9f7eaf5caacdef516a45314334dc5fc49fe2 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Wed, 22 Dec 2010 15:31:35 -0500 Subject: Create format_t::mark_uncompiled --- src/exprbase.h | 4 ++-- src/format.h | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/exprbase.h b/src/exprbase.h index 7eee0398..83ef34ff 100644 --- a/src/exprbase.h +++ b/src/exprbase.h @@ -131,11 +131,11 @@ public: set_text(original_string ? *original_string : ""); } - void mark_uncompiled() { + virtual void mark_uncompiled() { compiled = false; } - void recompile(scope_t& scope) { + void recompile(scope_t& scope) { compiled = false; compile(scope); } diff --git a/src/format.h b/src/format.h index a0b95567..256dd66a 100644 --- a/src/format.h +++ b/src/format.h @@ -142,6 +142,15 @@ public: set_text(_format); } + virtual void mark_uncompiled() { + for (element_t * elem = elements.get(); elem; elem = elem->next.get()) { + if (elem->type == element_t::EXPR) { + expr_t& expr(boost::get(elem->data)); + expr.mark_uncompiled(); + } + } + } + virtual result_type real_calc(scope_t& scope); virtual void dump(std::ostream& out) const { -- cgit v1.2.3