summaryrefslogtreecommitdiff
path: root/src/context.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2012-03-01 23:40:02 -0600
committerJohn Wiegley <johnw@newartisans.com>2012-03-01 23:40:02 -0600
commita125f24d29fd8275be7283a2edca9abc125703d7 (patch)
treeb649aeeef3b75be85cae8197467c5fb02066d486 /src/context.h
parentcfd7ffb12645c198a5b15891654f6ad6a0e4db27 (diff)
downloadfork-ledger-a125f24d29fd8275be7283a2edca9abc125703d7.tar.gz
fork-ledger-a125f24d29fd8275be7283a2edca9abc125703d7.tar.bz2
fork-ledger-a125f24d29fd8275be7283a2edca9abc125703d7.zip
Allow --options to be added by the user in Python
Diffstat (limited to 'src/context.h')
-rw-r--r--src/context.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/context.h b/src/context.h
index d7999e5a..45bb9990 100644
--- a/src/context.h
+++ b/src/context.h
@@ -71,6 +71,10 @@ public:
std::size_t count;
std::size_t sequence;
+ explicit parse_context_t(const path& cwd)
+ : current_directory(cwd), master(NULL), scope(NULL),
+ linenum(0), errors(0), count(0), sequence(1) {}
+
explicit parse_context_t(shared_ptr<std::istream> _stream,
const path& cwd)
: stream(_stream), current_directory(cwd), master(NULL),
@@ -126,6 +130,9 @@ class parse_context_stack_t
std::list<parse_context_t> parsing_context;
public:
+ void push() {
+ parsing_context.push_front(parse_context_t(filesystem::current_path()));
+ }
void push(shared_ptr<std::istream> stream,
const path& cwd = filesystem::current_path()) {
parsing_context.push_front(parse_context_t(stream, cwd));