summaryrefslogtreecommitdiff
path: root/src/expr.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-02-09 14:51:45 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-02-09 14:51:45 -0400
commit3ee3b8f327fa1943dba4ef6043559186b26f86b4 (patch)
tree31809a41826e69aa5ae3c3ed9789d2fb4a2fad52 /src/expr.cc
parente0fab726c6e9e5e9ecc5b8cd6a7be2e8233826a6 (diff)
downloadfork-ledger-3ee3b8f327fa1943dba4ef6043559186b26f86b4.tar.gz
fork-ledger-3ee3b8f327fa1943dba4ef6043559186b26f86b4.tar.bz2
fork-ledger-3ee3b8f327fa1943dba4ef6043559186b26f86b4.zip
Recompile the amount_expr before summing account totals.
Diffstat (limited to 'src/expr.cc')
-rw-r--r--src/expr.cc10
1 files changed, 8 insertions, 2 deletions
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()) {