From 16841fbae3adcb0a143d709e2597ce543bff084e Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Fri, 27 Aug 2004 23:38:39 -0400 Subject: added (disabled) code for Boost.Python --- textual.cc | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'textual.cc') diff --git a/textual.cc b/textual.cc index fa7f28d0..074e1f00 100644 --- a/textual.cc +++ b/textual.cc @@ -319,7 +319,7 @@ unsigned int textual_parser_t::parse(std::istream& in, unsigned int errors = 0; commodity_t * time_commodity = NULL; - std::list account_stack; + std::deque account_stack; automated_transactions_t auto_xacts; if (! master) @@ -546,8 +546,8 @@ unsigned int textual_parser_t::parse(std::istream& in, push_var save_linenum(linenum); push_var save_path(path); - count += parser_t::parse_file(skip_ws(line), journal, - account_stack.front()); + count += parse_journal_file(skip_ws(line), journal, + account_stack.front()); } break; @@ -590,3 +590,22 @@ unsigned int textual_parser_t::parse(std::istream& in, } } // namespace ledger + +#ifdef USE_BOOST_PYTHON + +#include + +using namespace boost::python; +using namespace ledger; + +BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(textual_parse_overloads, + textual_parser_t::parse, 2, 4) + +void export_textual() { + class_< textual_parser_t, bases > ("TextualParser") + .def("test", &textual_parser_t::test) + .def("parse", &textual_parser_t::parse, textual_parse_overloads()) + ; +} + +#endif // USE_BOOST_PYTHON -- cgit v1.2.3