summaryrefslogtreecommitdiff
path: root/src/textual.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2007-05-07 10:27:21 +0000
committerJohn Wiegley <johnw@newartisans.com>2008-04-13 03:38:39 -0400
commitd8498372037a4d0c272547ae48046b2182bcd4b1 (patch)
treeea3f228c5b6b20d71456e47a418e383669925d5f /src/textual.cc
parenta71d48881e538630aa1d147d58365da84e6db91f (diff)
downloadfork-ledger-d8498372037a4d0c272547ae48046b2182bcd4b1.tar.gz
fork-ledger-d8498372037a4d0c272547ae48046b2182bcd4b1.tar.bz2
fork-ledger-d8498372037a4d0c272547ae48046b2182bcd4b1.zip
Major restructuring of the value_t class.
Diffstat (limited to 'src/textual.cc')
-rw-r--r--src/textual.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/textual.cc b/src/textual.cc
index 39b970f9..f7e8e0b2 100644
--- a/src/textual.cc
+++ b/src/textual.cc
@@ -42,6 +42,7 @@ static unsigned int src_idx;
static accounts_map account_aliases;
typedef std::list<std::pair<path, int> > include_stack_t;
+
static include_stack_t include_stack;
#define TIMELOG_SUPPORT 1
@@ -98,7 +99,7 @@ parse_amount_expr(std::istream& in, journal_t *,
}
#endif
- amount = xpath.calc(xact.data).to_amount();
+ amount = xpath.calc(xact.data).as_amount();
DEBUG("ledger.textual.parse", "line " << linenum << ": " <<
"The transaction amount is " << amount);
@@ -174,11 +175,11 @@ transaction_t * parse_transaction(char * line,
char * e = &account_path[std::strlen(account_path) - 1];
if ((*b == '[' && *e == ']') ||
(*b == '(' && *e == ')')) {
- xact->flags |= TRANSACTION_VIRTUAL;
+ xact->add_flags(TRANSACTION_VIRTUAL);
DEBUG("ledger.textual.parse", "line " << linenum << ": " <<
"Parsed a virtual account name");
if (*b == '[') {
- xact->flags |= TRANSACTION_BALANCE;
+ xact->add_flags(TRANSACTION_BALANCE);
DEBUG("ledger.textual.parse", "line " << linenum << ": " <<
"Parsed a balanced virtual account name");
}
@@ -907,7 +908,7 @@ unsigned int textual_parser_t::parse(std::istream& in,
// parser to resolve alias references.
if (account_t * acct = account_stack.front()->find_account(e)) {
std::pair<accounts_map::iterator, bool> result
- = account_aliases.insert(accounts_pair(b, acct));
+ = account_aliases.insert(accounts_map::value_type(b, acct));
assert(result.second);
} else {
; // jww (2007-04-30): throw an error here