summaryrefslogtreecommitdiff
path: root/textual.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2004-08-10 17:54:47 -0400
committerJohn Wiegley <johnw@newartisans.com>2004-08-10 17:54:47 -0400
commit7a1d0d46146ecdb79a156ea1197bc3f1bd30cb95 (patch)
treefcca3d58b29c119ff42e70a08c35007b3e399d82 /textual.cc
parent799e97e420133eb25a321f30a61f857831a93dac (diff)
downloadfork-ledger-7a1d0d46146ecdb79a156ea1197bc3f1bd30cb95.tar.gz
fork-ledger-7a1d0d46146ecdb79a156ea1197bc3f1bd30cb95.tar.bz2
fork-ledger-7a1d0d46146ecdb79a156ea1197bc3f1bd30cb95.zip
new debug code; automated transactions now use value expression predicates
Diffstat (limited to 'textual.cc')
-rw-r--r--textual.cc29
1 files changed, 8 insertions, 21 deletions
diff --git a/textual.cc b/textual.cc
index 2e8b0fd0..7970c23a 100644
--- a/textual.cc
+++ b/textual.cc
@@ -131,36 +131,23 @@ void parse_automated_transactions(std::istream& in, account_t * account,
automated_transactions_t& auto_xacts)
{
static char line[MAX_LINE + 1];
+ in.getline(line, MAX_LINE);
+ linenum++;
- masks_list masks;
-
- while (! in.eof() && in.peek() == '=') {
- in.getline(line, MAX_LINE);
- linenum++;
-
- char * p = line + 1;
- p = skip_ws(p);
-
- masks.push_back(mask_t(p));
- }
-
- transactions_list xacts;
+ transactions_deque xacts;
- while (! in.eof() && (in.peek() == ' ' || in.peek() == '\t')) {
+ while (! in.eof() && (in.peek() == ' ' || in.peek() == '\t'))
if (transaction_t * xact = parse_transaction(in, account, NULL)) {
if (! xact->amount)
throw parse_error(path, linenum,
- "All automated transactions must have a value");
+ "All automated transactions must have values");
else
xacts.push_back(xact);
}
- }
- if (! masks.empty() && ! xacts.empty()) {
- automated_transaction_t * auto_xact
- = new automated_transaction_t(masks, xacts);
- auto_xacts.add_automated_transaction(auto_xact);
- }
+ if (! xacts.empty())
+ auto_xacts.
+ add_automated_transaction(new automated_transaction_t(line + 1, xacts));
}
bool finalize_entry(entry_t * entry)