summaryrefslogtreecommitdiff
path: root/textual.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2004-08-27 23:38:39 -0400
committerJohn Wiegley <johnw@newartisans.com>2004-08-27 23:38:39 -0400
commit16841fbae3adcb0a143d709e2597ce543bff084e (patch)
tree9683e8e1b4442b99e2d7f2e26cf409c89c0f10a6 /textual.cc
parentf0238fdd065ace9edbb65a45875f2f47a7a932d6 (diff)
downloadfork-ledger-16841fbae3adcb0a143d709e2597ce543bff084e.tar.gz
fork-ledger-16841fbae3adcb0a143d709e2597ce543bff084e.tar.bz2
fork-ledger-16841fbae3adcb0a143d709e2597ce543bff084e.zip
added (disabled) code for Boost.Python
Diffstat (limited to 'textual.cc')
-rw-r--r--textual.cc25
1 files changed, 22 insertions, 3 deletions
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_t *> account_stack;
+ std::deque<account_t *> account_stack;
automated_transactions_t auto_xacts;
if (! master)
@@ -546,8 +546,8 @@ unsigned int textual_parser_t::parse(std::istream& in,
push_var<unsigned int> save_linenum(linenum);
push_var<std::string> 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 <boost/python.hpp>
+
+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<parser_t> > ("TextualParser")
+ .def("test", &textual_parser_t::test)
+ .def("parse", &textual_parser_t::parse, textual_parse_overloads())
+ ;
+}
+
+#endif // USE_BOOST_PYTHON