summaryrefslogtreecommitdiff
path: root/src/op.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2012-03-13 10:33:51 -0500
committerJohn Wiegley <johnw@newartisans.com>2012-03-13 10:33:51 -0500
commite65fc729bc4d8adaa66b3fd702f93ef790155543 (patch)
tree7bc8b2cacab9ce1185ba6176434534eee18edcd0 /src/op.cc
parentc8dd3d28e3ed39ca93f9aac71a127f15c8d65e4b (diff)
downloadfork-ledger-e65fc729bc4d8adaa66b3fd702f93ef790155543.tar.gz
fork-ledger-e65fc729bc4d8adaa66b3fd702f93ef790155543.tar.bz2
fork-ledger-e65fc729bc4d8adaa66b3fd702f93ef790155543.zip
Made split_cons_expr a global function
Diffstat (limited to 'src/op.cc')
-rw-r--r--src/op.cc42
1 files changed, 21 insertions, 21 deletions
diff --git a/src/op.cc b/src/op.cc
index 23f47f73..7f2418b1 100644
--- a/src/op.cc
+++ b/src/op.cc
@@ -48,31 +48,31 @@ void intrusive_ptr_release(const expr_t::op_t * op)
op->release();
}
-namespace {
- value_t split_cons_expr(expr_t::ptr_op_t op)
- {
- if (op->kind == expr_t::op_t::O_CONS) {
- value_t seq;
- seq.push_back(expr_value(op->left()));
-
- expr_t::ptr_op_t next = op->right();
- while (next) {
- expr_t::ptr_op_t value_op;
- if (next->kind == expr_t::op_t::O_CONS) {
- value_op = next->left();
- next = next->has_right() ? next->right() : NULL;
- } else {
- value_op = next;
- next = NULL;
- }
- seq.push_back(expr_value(value_op));
+value_t split_cons_expr(expr_t::ptr_op_t op)
+{
+ if (op->kind == expr_t::op_t::O_CONS) {
+ value_t seq;
+ seq.push_back(expr_value(op->left()));
+
+ expr_t::ptr_op_t next = op->right();
+ while (next) {
+ expr_t::ptr_op_t value_op;
+ if (next->kind == expr_t::op_t::O_CONS) {
+ value_op = next->left();
+ next = next->has_right() ? next->right() : NULL;
+ } else {
+ value_op = next;
+ next = NULL;
}
- return seq;
- } else {
- return expr_value(op);
+ seq.push_back(expr_value(value_op));
}
+ return seq;
+ } else {
+ return expr_value(op);
}
+}
+namespace {
inline void check_type_context(scope_t& scope, value_t& result)
{
if (scope.type_required() &&