Removed todo comments and dead code.
This commit is contained in:
parent
b89fcfb54a
commit
bbf4da9d9b
2 changed files with 0 additions and 61 deletions
59
src/scope.cc
59
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
|
||||
|
|
|
|||
|
|
@ -166,11 +166,9 @@ public:
|
|||
}
|
||||
|
||||
value_t& operator[](const unsigned int index) {
|
||||
// jww (2008-07-21): exception here if it's out of bounds
|
||||
return args[index];
|
||||
}
|
||||
const value_t& operator[](const unsigned int index) const {
|
||||
// jww (2008-07-21): exception here if it's out of bounds
|
||||
return args[index];
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue