summaryrefslogtreecommitdiff
path: root/src/op.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-01-22 18:53:08 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-01-22 18:53:08 -0400
commit965df4a404f7c47b2cb5a61411538d8849a76508 (patch)
treeed13ee1e2c56206a088e885de90953427090edab /src/op.cc
parent0859b626a1eacb0e3bb598c8b33c6f9528f842c3 (diff)
downloadfork-ledger-965df4a404f7c47b2cb5a61411538d8849a76508.tar.gz
fork-ledger-965df4a404f7c47b2cb5a61411538d8849a76508.tar.bz2
fork-ledger-965df4a404f7c47b2cb5a61411538d8849a76508.zip
Whitespace changes.
Diffstat (limited to 'src/op.cc')
-rw-r--r--src/op.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/op.cc b/src/op.cc
index 45d0e493..62985a8e 100644
--- a/src/op.cc
+++ b/src/op.cc
@@ -40,8 +40,9 @@ expr_t::ptr_op_t expr_t::op_t::compile(scope_t& scope)
switch (kind) {
case IDENT:
if (ptr_op_t def = scope.lookup(as_ident())) {
- // Definitions are compiled at the point of definition, not the
- // point of use.
+ // Identifier references are first looked up at the point of
+ // definition, and then at the point of every use if they could
+ // not be found there.
return copy(def);
}
return this;
@@ -54,7 +55,8 @@ expr_t::ptr_op_t expr_t::op_t::compile(scope_t& scope)
return this;
ptr_op_t lhs(left()->compile(scope));
- ptr_op_t rhs(kind > UNARY_OPERATORS ? right()->compile(scope) : ptr_op_t());
+ ptr_op_t rhs(kind > UNARY_OPERATORS && has_right() ?
+ right()->compile(scope) : ptr_op_t());
if (lhs == left() && (! rhs || rhs == right()))
return this;