diff options
author | John Wiegley <johnw@newartisans.com> | 2009-11-05 04:24:15 -0500 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-11-05 04:24:15 -0500 |
commit | 15555d497f56e4b4d39e9a14f74b2c82cce52b90 (patch) | |
tree | 1e6c661379f02fdc52ef107fd500438ab69f3e60 /src/py_scope.cc | |
parent | 94b2518c4156e5a6b2be45bdbeeacf1ced0cd17f (diff) | |
parent | 060fc0e00bacb96d1d16163779d98c45c3999014 (diff) | |
download | fork-ledger-15555d497f56e4b4d39e9a14f74b2c82cce52b90.tar.gz fork-ledger-15555d497f56e4b4d39e9a14f74b2c82cce52b90.tar.bz2 fork-ledger-15555d497f56e4b4d39e9a14f74b2c82cce52b90.zip |
Merge branch 'next'
Diffstat (limited to 'src/py_scope.cc')
-rw-r--r-- | src/py_scope.cc | 56 |
1 files changed, 7 insertions, 49 deletions
diff --git a/src/py_scope.cc b/src/py_scope.cc index cc85030c..c5c4fff6 100644 --- a/src/py_scope.cc +++ b/src/py_scope.cc @@ -38,59 +38,17 @@ namespace ledger { using namespace boost::python; namespace { - void py_scope_define(scope_t& scope, const string& name, expr_t& def) - { - return scope.define(name, def.get_op()); - } - - expr_t py_scope_lookup(scope_t& scope, const string& name) - { - return scope.lookup(name); - } - - value_t py_scope_getattr(scope_t& scope, const string& name) - { - return expr_t(scope.lookup(name)).calc(scope); - } - - struct scope_wrapper : public scope_t - { - PyObject * self; - - scope_wrapper(PyObject * self_) : self(self_) {} - - virtual expr_t::ptr_op_t lookup(const string&) { - return NULL; - } - }; } void export_scope() { - class_< scope_t, scope_wrapper, boost::noncopyable > ("Scope", no_init) - .def("define", py_scope_define) - .def("lookup", py_scope_lookup) - .def("__getattr__", py_scope_getattr) - ; - - class_< child_scope_t, bases<scope_t>, - boost::noncopyable > ("ChildScope") - .def(init<>()) - .def(init<scope_t&>()) - ; - - class_< symbol_scope_t, bases<child_scope_t>, - boost::noncopyable > ("SymbolScope") - .def(init<>()) - .def(init<scope_t&>()) - ; - - class_< call_scope_t, bases<child_scope_t>, - boost::noncopyable > ("CallScope", init<scope_t&>()) - ; - - class_< bind_scope_t, bases<child_scope_t>, - boost::noncopyable > ("BindScope", init<scope_t&, scope_t&>()) + class_< scope_t, boost::noncopyable > ("Scope", no_init) +#if 0 + .def("is_posting", ) + .def("is_transaction", ) + .def("is_account", ) + .def("is_journal", ) +#endif ; } |