summaryrefslogtreecommitdiff
path: root/valexpr.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2006-03-01 04:46:21 +0000
committerJohn Wiegley <johnw@newartisans.com>2008-04-13 02:41:28 -0400
commit68813448cbac88cff9c7f60021a0e255e2445375 (patch)
treee93f9b57f9ec578ea99b9ac2b8de0f55e7a6ef96 /valexpr.cc
parent72a5f48d9d8ca6db9e3cb8069272d8cb4834a6c9 (diff)
downloadfork-ledger-68813448cbac88cff9c7f60021a0e255e2445375.tar.gz
fork-ledger-68813448cbac88cff9c7f60021a0e255e2445375.tar.bz2
fork-ledger-68813448cbac88cff9c7f60021a0e255e2445375.zip
Added support for unlimited factoids.
Diffstat (limited to 'valexpr.cc')
-rw-r--r--valexpr.cc9
1 files changed, 3 insertions, 6 deletions
diff --git a/valexpr.cc b/valexpr.cc
index 8222da40..a5cb481f 100644
--- a/valexpr.cc
+++ b/valexpr.cc
@@ -1279,8 +1279,7 @@ void init_value_expr()
globals->define("P", node);
globals->define("val", node);
globals->define("value", node);
- node = parse_boolean_expr("current_value(x)=P(x,m)", globals);
- delete node;
+ value_auto_ptr cval(parse_boolean_expr("current_value(x)=P(x,m)", globals));
// Macros
node = parse_value_expr("P(a,d)");
@@ -1299,10 +1298,8 @@ void init_value_expr()
globals->define("G", node);
globals->define("gain_total", node);
- node = parse_boolean_expr("min(x,y)=x<y?x:y", globals);
- delete node;
- node = parse_boolean_expr("max(x,y)=x>y?x:y", globals);
- delete node;
+ value_auto_ptr minx(parse_boolean_expr("min(x,y)=x<y?x:y", globals));
+ value_auto_ptr maxx(parse_boolean_expr("max(x,y)=x>y?x:y", globals));
}
value_expr_t * parse_value_expr(std::istream& in, scope_t * scope,