summaryrefslogtreecommitdiff
path: root/src/scope.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2008-08-17 05:19:51 -0400
committerJohn Wiegley <johnw@newartisans.com>2008-08-17 05:19:51 -0400
commitbbf4da9d9bcf8b2537f380fce94ddbdb226f9704 (patch)
tree24972fe2c4571cf1d32a8c58a7af70a0f9ae4b09 /src/scope.cc
parentb89fcfb54a198c2b749302da29b49ef088067feb (diff)
downloadfork-ledger-bbf4da9d9bcf8b2537f380fce94ddbdb226f9704.tar.gz
fork-ledger-bbf4da9d9bcf8b2537f380fce94ddbdb226f9704.tar.bz2
fork-ledger-bbf4da9d9bcf8b2537f380fce94ddbdb226f9704.zip
Removed todo comments and dead code.
Diffstat (limited to 'src/scope.cc')
-rw-r--r--src/scope.cc59
1 files changed, 0 insertions, 59 deletions
diff --git a/src/scope.cc b/src/scope.cc
index 7a349949..7ab3efe6 100644
--- a/src/scope.cc
+++ b/src/scope.cc
@@ -61,63 +61,4 @@ expr_t::ptr_op_t symbol_scope_t::lookup(const string& name)
return child_scope_t::lookup(name);
}
-#if 0
-namespace {
- int count_leaves(expr_t::ptr_op_t expr)
- {
- int count = 0;
- if (expr->kind != expr_t::op_t::O_COMMA) {
- count = 1;
- } else {
- count += count_leaves(expr->left());
- count += count_leaves(expr->right());
- }
- return count;
- }
-
- expr_t::ptr_op_t reduce_leaves(expr_t::ptr_op_t expr,
- expr_t::ptr_op_t context)
- {
- if (! expr)
- return NULL;
-
- expr_t::ptr_op_t temp;
-
- if (expr->kind != expr_t::op_t::O_COMMA) {
- if (expr->kind < expr_t::op_t::TERMINALS) {
- temp.reset(expr);
- } else {
- temp.reset(new op_t(expr_t::op_t::VALUE));
- temp->set_value(NULL_VALUE);
- expr->compute(temp->as_value_lval(), context);
- }
- } else {
- temp.reset(new op_t(expr_t::op_t::O_COMMA));
- temp->set_left(reduce_leaves(expr->left(), context));
- temp->set_right(reduce_leaves(expr->right(), context));
- }
- return temp.release();
- }
-
- expr_t::ptr_op_t find_leaf(expr_t::ptr_op_t context, int goal, long& found)
- {
- if (! context)
- return NULL;
-
- if (context->kind != expr_t::op_t::O_COMMA) {
- if (goal == found++)
- return context;
- } else {
- expr_t::ptr_op_t expr = find_leaf(context->left(), goal, found);
- if (expr)
- return expr;
- expr = find_leaf(context->right(), goal, found);
- if (expr)
- return expr;
- }
- return NULL;
- }
-}
-#endif
-
} // namespace ledger