summaryrefslogtreecommitdiff
path: root/src/scope.cc
diff options
context:
space:
mode:
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