summaryrefslogtreecommitdiff
path: root/expr.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2008-08-01 02:20:09 -0400
committerJohn Wiegley <johnw@newartisans.com>2008-08-01 02:20:29 -0400
commitd213b32ffc6adaffa8e9ea4081b47c7b9403112c (patch)
treee91932047c126b41f72ec17f6e44f3c25eb85b33 /expr.h
parentc98be731733176c9e9afb690619d806630ec9090 (diff)
downloadledger-d213b32ffc6adaffa8e9ea4081b47c7b9403112c.tar.gz
ledger-d213b32ffc6adaffa8e9ea4081b47c7b9403112c.tar.bz2
ledger-d213b32ffc6adaffa8e9ea4081b47c7b9403112c.zip
Value expressions now auto-compile themselves on first use if the expr_t
object is not constant. This saves classes that use expr_t from having to track such a detail themselves.
Diffstat (limited to 'expr.h')
-rw-r--r--expr.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/expr.h b/expr.h
index ab8c07f2..bfb372b6 100644
--- a/expr.h
+++ b/expr.h
@@ -59,6 +59,7 @@ public:
private:
ptr_op_t ptr;
string str;
+ bool compiled;
static void initialize();
static void shutdown();
@@ -97,6 +98,7 @@ public:
void parse(std::istream& in, const unsigned int flags = 0);
void compile(scope_t& scope);
+ value_t calc(scope_t& scope);
value_t calc(scope_t& scope) const;
bool is_constant() const;