summaryrefslogtreecommitdiff
path: root/src/account.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-11-05 04:24:15 -0500
committerJohn Wiegley <johnw@newartisans.com>2009-11-05 04:24:15 -0500
commit15555d497f56e4b4d39e9a14f74b2c82cce52b90 (patch)
tree1e6c661379f02fdc52ef107fd500438ab69f3e60 /src/account.cc
parent94b2518c4156e5a6b2be45bdbeeacf1ced0cd17f (diff)
parent060fc0e00bacb96d1d16163779d98c45c3999014 (diff)
downloadfork-ledger-15555d497f56e4b4d39e9a14f74b2c82cce52b90.tar.gz
fork-ledger-15555d497f56e4b4d39e9a14f74b2c82cce52b90.tar.bz2
fork-ledger-15555d497f56e4b4d39e9a14f74b2c82cce52b90.zip
Merge branch 'next'
Diffstat (limited to 'src/account.cc')
-rw-r--r--src/account.cc15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/account.cc b/src/account.cc
index 23761049..43b7cd56 100644
--- a/src/account.cc
+++ b/src/account.cc
@@ -241,8 +241,12 @@ namespace {
}
}
-expr_t::ptr_op_t account_t::lookup(const string& name)
+expr_t::ptr_op_t account_t::lookup(const symbol_t::kind_t kind,
+ const string& name)
{
+ if (kind != symbol_t::FUNCTION)
+ return NULL;
+
switch (name[0]) {
case 'a':
if (name == "amount")
@@ -378,6 +382,15 @@ account_t::xdata_t::details_t::operator+=(const details_t& other)
return *this;
}
+void account_t::clear_xdata()
+{
+ xdata_ = none;
+
+ foreach (accounts_map::value_type& pair, accounts)
+ if (! pair.second->has_flags(ACCOUNT_TEMP))
+ pair.second->clear_xdata();
+}
+
value_t account_t::amount(const optional<expr_t&>& expr) const
{
if (xdata_ && xdata_->has_flags(ACCOUNT_EXT_VISITED)) {