summaryrefslogtreecommitdiff
path: root/textual.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2008-07-20 23:12:04 -0400
committerJohn Wiegley <johnw@newartisans.com>2008-07-20 23:12:04 -0400
commitd86a91d45b837d1d32e943107c856497897cc85c (patch)
tree3e9ca05a7126facb6b2ad7cd9447d4bc7c149d6c /textual.cc
parent689df610779d43bf740925a90ab3579b22d45da8 (diff)
downloadledger-d86a91d45b837d1d32e943107c856497897cc85c.tar.gz
ledger-d86a91d45b837d1d32e943107c856497897cc85c.tar.bz2
ledger-d86a91d45b837d1d32e943107c856497897cc85c.zip
The new XPath parser has been integrated, although I have removed the
XML-related bits -- I just wanted the better infrastructure that had been created during the rewrite. It doesn't work, but it compiles and links now. This means that all of the previous 3.0 code has been moved over, although there are still snippets of code in pending/old that need to be restored.
Diffstat (limited to 'textual.cc')
-rw-r--r--textual.cc14
1 files changed, 7 insertions, 7 deletions
diff --git a/textual.cc b/textual.cc
index b83ae82c..9d34a861 100644
--- a/textual.cc
+++ b/textual.cc
@@ -45,8 +45,8 @@ static value_expr parse_amount_expr(std::istream& in, amount_t& amount,
transaction_t * xact,
unsigned short flags = 0)
{
- value_expr expr(expr::parse_value_expr(in, NULL, flags | PARSE_VALEXPR_RELAXED |
- PARSE_VALEXPR_PARTIAL));
+ value_expr expr(expr::parser_t(in, flags | EXPR_PARSE_RELAXED |
+ EXPR_PARSE_PARTIAL));
DEBUG("ledger.textual.parse", "line " << linenum << ": " <<
"Parsed an amount expression");
@@ -172,7 +172,7 @@ transaction_t * parse_transaction(char * line, account_t * account,
xact->amount_expr =
parse_amount_expr(in, xact->amount, xact.get(),
- PARSE_VALEXPR_NO_REDUCE);
+ EXPR_PARSE_NO_REDUCE);
saw_amount = true;
xact->amount.reduce();
@@ -180,7 +180,7 @@ transaction_t * parse_transaction(char * line, account_t * account,
"Reduced amount is " << xact->amount);
unsigned long end = (long)in.tellg();
- xact->amount_expr.expr = string(line, beg, end - beg);
+ xact->amount_expr.expr_str = string(line, beg, end - beg);
}
catch (error * err) {
err_desc = "While parsing transaction amount:";
@@ -215,7 +215,7 @@ transaction_t * parse_transaction(char * line, account_t * account,
unsigned long beg = (long)in.tellg();
if (parse_amount_expr(in, *xact->cost, xact.get(),
- PARSE_VALEXPR_NO_MIGRATE))
+ EXPR_PARSE_NO_MIGRATE))
throw new parse_error
("A transaction's cost must evaluate to a constant value");
@@ -845,8 +845,8 @@ unsigned int textual_parser_t::parse(std::istream& in,
#if 0
if (! expr::global_scope.get())
init_value_expr();
-#endif
parse_value_definition(p);
+#endif
}
break;
}
@@ -984,7 +984,7 @@ void write_textual_journal(journal_t& journal, path pathname,
base = *el++;
}
else if (al != journal.auto_entries.end() && pos == (*al)->beg_pos) {
- out << "= " << (*al)->predicate.predicate.expr << '\n';
+ out << "= " << (*al)->predicate.predicate.expr_str << '\n';
base = *al++;
}
else if (pl != journal.period_entries.end() && pos == (*pl)->beg_pos) {