From 3ee3b8f327fa1943dba4ef6043559186b26f86b4 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Mon, 9 Feb 2009 14:51:45 -0400 Subject: Recompile the amount_expr before summing account totals. --- src/expr.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/expr.cc') diff --git a/src/expr.cc b/src/expr.cc index 14fb2be8..b0262f17 100644 --- a/src/expr.cc +++ b/src/expr.cc @@ -107,15 +107,21 @@ void expr_t::parse(std::istream& in, const uint32_t flags, compiled = false; } -void expr_t::compile(scope_t& scope) +void expr_t::recompile(scope_t& scope) { - if (ptr.get() && ! compiled) { + if (ptr.get()) { ptr = ptr->compile(scope); context = &scope; compiled = true; } } +void expr_t::compile(scope_t& scope) +{ + if (! compiled) + recompile(scope); +} + value_t expr_t::calc(scope_t& scope) { if (ptr.get()) { -- cgit v1.2.3