summaryrefslogtreecommitdiff
path: root/src/op.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2012-03-13 10:33:59 -0500
committerJohn Wiegley <johnw@newartisans.com>2012-03-13 10:33:59 -0500
commit927d404ad5d145bbcc58e0a4f9ee5d5df0637160 (patch)
tree9328e2eeb0149833100571333ecfec1b554a9788 /src/op.cc
parente65fc729bc4d8adaa66b3fd702f93ef790155543 (diff)
downloadfork-ledger-927d404ad5d145bbcc58e0a4f9ee5d5df0637160.tar.gz
fork-ledger-927d404ad5d145bbcc58e0a4f9ee5d5df0637160.tar.bz2
fork-ledger-927d404ad5d145bbcc58e0a4f9ee5d5df0637160.zip
Added a syntax error check
Diffstat (limited to 'src/op.cc')
-rw-r--r--src/op.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/op.cc b/src/op.cc
index 7f2418b1..8be0796a 100644
--- a/src/op.cc
+++ b/src/op.cc
@@ -198,6 +198,9 @@ expr_t::ptr_op_t expr_t::op_t::compile(scope_t& scope, const int depth,
}
if (! result) {
+ if (! left())
+ throw_(calc_error, _("Syntax error"));
+
ptr_op_t lhs(left()->compile(*scope_ptr, depth + 1, param_scope));
ptr_op_t rhs(kind > UNARY_OPERATORS && has_right() ?
(kind == O_LOOKUP ? right() :