Changed debug class ledger.textual.parse to just textual.parse.
This commit is contained in:
parent
5b5d6ac0ce
commit
a374979aaa
1 changed files with 21 additions and 21 deletions
|
|
@ -88,11 +88,11 @@ namespace {
|
||||||
{
|
{
|
||||||
expr_t expr(in, flags | EXPR_PARSE_PARTIAL);
|
expr_t expr(in, flags | EXPR_PARSE_PARTIAL);
|
||||||
|
|
||||||
DEBUG("ledger.textual.parse", "line " << linenum << ": " <<
|
DEBUG("textual.parse", "line " << linenum << ": " <<
|
||||||
"Parsed an amount expression");
|
"Parsed an amount expression");
|
||||||
|
|
||||||
#ifdef DEBUG_ENABLED
|
#ifdef DEBUG_ENABLED
|
||||||
DEBUG_IF("ledger.textual.parse") {
|
DEBUG_IF("textual.parse") {
|
||||||
if (_debug_stream) {
|
if (_debug_stream) {
|
||||||
ledger::dump_value_expr(*_debug_stream, expr);
|
ledger::dump_value_expr(*_debug_stream, expr);
|
||||||
*_debug_stream << std::endl;
|
*_debug_stream << std::endl;
|
||||||
|
|
@ -102,7 +102,7 @@ namespace {
|
||||||
|
|
||||||
if (expr) {
|
if (expr) {
|
||||||
amount = expr.calc(*xact).as_amount();
|
amount = expr.calc(*xact).as_amount();
|
||||||
DEBUG("ledger.textual.parse", "line " << linenum << ": " <<
|
DEBUG("textual.parse", "line " << linenum << ": " <<
|
||||||
"The transaction amount is " << amount);
|
"The transaction amount is " << amount);
|
||||||
return expr;
|
return expr;
|
||||||
}
|
}
|
||||||
|
|
@ -130,14 +130,14 @@ xact_t * parse_xact(char * line, account_t * account, entry_t * entry = NULL)
|
||||||
xact->set_state(item_t::CLEARED);
|
xact->set_state(item_t::CLEARED);
|
||||||
in.get(p);
|
in.get(p);
|
||||||
p = peek_next_nonws(in);
|
p = peek_next_nonws(in);
|
||||||
DEBUG("ledger.textual.parse", "line " << linenum << ": " <<
|
DEBUG("textual.parse", "line " << linenum << ": " <<
|
||||||
"Parsed the CLEARED flag");
|
"Parsed the CLEARED flag");
|
||||||
break;
|
break;
|
||||||
case '!':
|
case '!':
|
||||||
xact->set_state(item_t::PENDING);
|
xact->set_state(item_t::PENDING);
|
||||||
in.get(p);
|
in.get(p);
|
||||||
p = peek_next_nonws(in);
|
p = peek_next_nonws(in);
|
||||||
DEBUG("ledger.textual.parse", "line " << linenum << ": " <<
|
DEBUG("textual.parse", "line " << linenum << ": " <<
|
||||||
"Parsed the PENDING flag");
|
"Parsed the PENDING flag");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -164,19 +164,19 @@ xact_t * parse_xact(char * line, account_t * account, entry_t * entry = NULL)
|
||||||
if ((*b == '[' && *(e - 1) == ']') ||
|
if ((*b == '[' && *(e - 1) == ']') ||
|
||||||
(*b == '(' && *(e - 1) == ')')) {
|
(*b == '(' && *(e - 1) == ')')) {
|
||||||
xact->add_flags(XACT_VIRTUAL);
|
xact->add_flags(XACT_VIRTUAL);
|
||||||
DEBUG("ledger.textual.parse",
|
DEBUG("textual.parse",
|
||||||
"line " << linenum << ": " << "Parsed a virtual account name");
|
"line " << linenum << ": " << "Parsed a virtual account name");
|
||||||
|
|
||||||
if (*b == '[') {
|
if (*b == '[') {
|
||||||
xact->add_flags(XACT_MUST_BALANCE);
|
xact->add_flags(XACT_MUST_BALANCE);
|
||||||
DEBUG("ledger.textual.parse",
|
DEBUG("textual.parse",
|
||||||
"line " << linenum << ": " << "Transaction must balance");
|
"line " << linenum << ": " << "Transaction must balance");
|
||||||
}
|
}
|
||||||
b++; e--;
|
b++; e--;
|
||||||
}
|
}
|
||||||
|
|
||||||
string name(b, e - b);
|
string name(b, e - b);
|
||||||
DEBUG("ledger.textual.parse", "line " << linenum << ": " <<
|
DEBUG("textual.parse", "line " << linenum << ": " <<
|
||||||
"Parsed account name " << name);
|
"Parsed account name " << name);
|
||||||
if (account_aliases.size() > 0) {
|
if (account_aliases.size() > 0) {
|
||||||
accounts_map::const_iterator i = account_aliases.find(name);
|
accounts_map::const_iterator i = account_aliases.find(name);
|
||||||
|
|
@ -209,7 +209,7 @@ xact_t * parse_xact(char * line, account_t * account, entry_t * entry = NULL)
|
||||||
|
|
||||||
if (! xact->amount.is_null()) {
|
if (! xact->amount.is_null()) {
|
||||||
xact->amount.reduce();
|
xact->amount.reduce();
|
||||||
DEBUG("ledger.textual.parse", "line " << linenum << ": " <<
|
DEBUG("textual.parse", "line " << linenum << ": " <<
|
||||||
"Reduced amount is " << xact->amount);
|
"Reduced amount is " << xact->amount);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -238,14 +238,14 @@ xact_t * parse_xact(char * line, account_t * account, entry_t * entry = NULL)
|
||||||
throw parse_error
|
throw parse_error
|
||||||
("Transaction cannot have a cost expression with an amount");
|
("Transaction cannot have a cost expression with an amount");
|
||||||
|
|
||||||
DEBUG("ledger.textual.parse", "line " << linenum << ": " <<
|
DEBUG("textual.parse", "line " << linenum << ": " <<
|
||||||
"Found a price indicator");
|
"Found a price indicator");
|
||||||
bool per_unit = true;
|
bool per_unit = true;
|
||||||
in.get(p);
|
in.get(p);
|
||||||
if (in.peek() == '@') {
|
if (in.peek() == '@') {
|
||||||
in.get(p);
|
in.get(p);
|
||||||
per_unit = false;
|
per_unit = false;
|
||||||
DEBUG("ledger.textual.parse", "line " << linenum << ": " <<
|
DEBUG("textual.parse", "line " << linenum << ": " <<
|
||||||
"And it's for a total price");
|
"And it's for a total price");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -288,11 +288,11 @@ xact_t * parse_xact(char * line, account_t * account, entry_t * entry = NULL)
|
||||||
! xact->amount.commodity().annotated)
|
! xact->amount.commodity().annotated)
|
||||||
xact->amount.annotate(annotation_t(per_unit_cost));
|
xact->amount.annotate(annotation_t(per_unit_cost));
|
||||||
|
|
||||||
DEBUG("ledger.textual.parse", "line " << linenum << ": " <<
|
DEBUG("textual.parse", "line " << linenum << ": " <<
|
||||||
"Total cost is " << *xact->cost);
|
"Total cost is " << *xact->cost);
|
||||||
DEBUG("ledger.textual.parse", "line " << linenum << ": " <<
|
DEBUG("textual.parse", "line " << linenum << ": " <<
|
||||||
"Per-unit cost is " << per_unit_cost);
|
"Per-unit cost is " << per_unit_cost);
|
||||||
DEBUG("ledger.textual.parse", "line " << linenum << ": " <<
|
DEBUG("textual.parse", "line " << linenum << ": " <<
|
||||||
"Annotated amount is " << xact->amount);
|
"Annotated amount is " << xact->amount);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -306,7 +306,7 @@ xact_t * parse_xact(char * line, account_t * account, entry_t * entry = NULL)
|
||||||
p = peek_next_nonws(in);
|
p = peek_next_nonws(in);
|
||||||
if (p == '=') {
|
if (p == '=') {
|
||||||
in.get(p);
|
in.get(p);
|
||||||
DEBUG("ledger.textual.parse", "line " << linenum << ": " <<
|
DEBUG("textual.parse", "line " << linenum << ": " <<
|
||||||
"Found a balance assignment indicator");
|
"Found a balance assignment indicator");
|
||||||
if (in.good() && ! in.eof()) {
|
if (in.good() && ! in.eof()) {
|
||||||
xact->assigned_amount = amount_t();
|
xact->assigned_amount = amount_t();
|
||||||
|
|
@ -322,7 +322,7 @@ xact_t * parse_xact(char * line, account_t * account, entry_t * entry = NULL)
|
||||||
throw parse_error
|
throw parse_error
|
||||||
("An assigned balance must evaluate to a constant value");
|
("An assigned balance must evaluate to a constant value");
|
||||||
|
|
||||||
DEBUG("ledger.textual.parse", "line " << linenum << ": " <<
|
DEBUG("textual.parse", "line " << linenum << ": " <<
|
||||||
"XACT assign: parsed amt = " << *xact->assigned_amount);
|
"XACT assign: parsed amt = " << *xact->assigned_amount);
|
||||||
|
|
||||||
if (xact->assigned_amount_expr) {
|
if (xact->assigned_amount_expr) {
|
||||||
|
|
@ -362,7 +362,7 @@ xact_t * parse_xact(char * line, account_t * account, entry_t * entry = NULL)
|
||||||
}
|
}
|
||||||
|
|
||||||
DEBUG("xact.assign", "diff = " << diff.strip_annotations());
|
DEBUG("xact.assign", "diff = " << diff.strip_annotations());
|
||||||
DEBUG("ledger.textual.parse", "line " << linenum << ": " <<
|
DEBUG("textual.parse", "line " << linenum << ": " <<
|
||||||
"XACT assign: diff = " << diff.strip_annotations());
|
"XACT assign: diff = " << diff.strip_annotations());
|
||||||
|
|
||||||
if (! diff.is_zero()) {
|
if (! diff.is_zero()) {
|
||||||
|
|
@ -373,12 +373,12 @@ xact_t * parse_xact(char * line, account_t * account, entry_t * entry = NULL)
|
||||||
ITEM_GENERATED | XACT_CALCULATED);
|
ITEM_GENERATED | XACT_CALCULATED);
|
||||||
entry->add_xact(temp);
|
entry->add_xact(temp);
|
||||||
|
|
||||||
DEBUG("ledger.textual.parse", "line " << linenum << ": " <<
|
DEBUG("textual.parse", "line " << linenum << ": " <<
|
||||||
"Created balancing transaction");
|
"Created balancing transaction");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
xact->amount = diff;
|
xact->amount = diff;
|
||||||
DEBUG("ledger.textual.parse", "line " << linenum << ": " <<
|
DEBUG("textual.parse", "line " << linenum << ": " <<
|
||||||
"Overwrite null transaction");
|
"Overwrite null transaction");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -401,7 +401,7 @@ xact_t * parse_xact(char * line, account_t * account, entry_t * entry = NULL)
|
||||||
in.get(p);
|
in.get(p);
|
||||||
p = peek_next_nonws(in);
|
p = peek_next_nonws(in);
|
||||||
xact->note = &line[long(in.tellg())];
|
xact->note = &line[long(in.tellg())];
|
||||||
DEBUG("ledger.textual.parse", "line " << linenum << ": " <<
|
DEBUG("textual.parse", "line " << linenum << ": " <<
|
||||||
"Parsed a note '" << *xact->note << "'");
|
"Parsed a note '" << *xact->note << "'");
|
||||||
|
|
||||||
if (char * b = std::strchr(xact->note->c_str(), '['))
|
if (char * b = std::strchr(xact->note->c_str(), '['))
|
||||||
|
|
@ -410,7 +410,7 @@ xact_t * parse_xact(char * line, account_t * account, entry_t * entry = NULL)
|
||||||
std::strncpy(buf, b + 1, e - b - 1);
|
std::strncpy(buf, b + 1, e - b - 1);
|
||||||
buf[e - b - 1] = '\0';
|
buf[e - b - 1] = '\0';
|
||||||
|
|
||||||
DEBUG("ledger.textual.parse", "line " << linenum << ": " <<
|
DEBUG("textual.parse", "line " << linenum << ": " <<
|
||||||
"Parsed a transaction date " << buf);
|
"Parsed a transaction date " << buf);
|
||||||
|
|
||||||
if (char * p = std::strchr(buf, '=')) {
|
if (char * p = std::strchr(buf, '=')) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue