summaryrefslogtreecommitdiff
path: root/src/op.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2010-06-13 18:39:26 -0400
committerJohn Wiegley <johnw@newartisans.com>2010-06-13 18:39:26 -0400
commit2ea075dc4f48b5212a2b404e59ce16147871ba86 (patch)
tree52dc360b9afed97ac85774256bfa9f7dfe237590 /src/op.cc
parent7708ed1a750fb3dd79fad1562f0fec8a06422339 (diff)
downloadfork-ledger-2ea075dc4f48b5212a2b404e59ce16147871ba86.tar.gz
fork-ledger-2ea075dc4f48b5212a2b404e59ce16147871ba86.tar.bz2
fork-ledger-2ea075dc4f48b5212a2b404e59ce16147871ba86.zip
Report error context in expressions more precisely
Diffstat (limited to 'src/op.cc')
-rw-r--r--src/op.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/op.cc b/src/op.cc
index c2001ec3..d7588b66 100644
--- a/src/op.cc
+++ b/src/op.cc
@@ -157,7 +157,7 @@ value_t expr_t::op_t::calc(scope_t& scope, ptr_op_t * locus, const int depth)
// Evaluating an identifier is the same as calling its definition
// directly, so we create an empty call_scope_t to reflect the scope for
// this implicit call.
- call_scope_t call_args(scope, scope.type_context(), scope.type_required());
+ call_scope_t call_args(scope, locus, depth);
result = left()->compile(call_args, depth + 1)
->calc(call_args, locus, depth + 1);
check_type_context(scope, result);
@@ -168,7 +168,7 @@ value_t expr_t::op_t::calc(scope_t& scope, ptr_op_t * locus, const int depth)
// Evaluating a FUNCTION is the same as calling it directly; this happens
// when certain functions-that-look-like-variables (such as "amount") are
// resolved.
- call_scope_t call_args(scope, scope.type_context(), scope.type_required());
+ call_scope_t call_args(scope, locus, depth);
result = as_function()(call_args);
check_type_context(scope, result);
#if defined(DEBUG_ON)
@@ -235,7 +235,7 @@ value_t expr_t::op_t::calc(scope_t& scope, ptr_op_t * locus, const int depth)
}
case O_CALL: {
- call_scope_t call_args(scope, scope.type_context(), scope.type_required());
+ call_scope_t call_args(scope, locus, depth);
if (has_right())
call_args.set_args(split_cons_expr(right()->kind == O_SEQ ?
right()->left() : right()));