From c1bd3b5824027f23b41bbac77c5e28f856c5dc18 Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Mon, 21 Sep 2015 11:24:49 -0700 Subject: Eliminate global variables associated with builtin IO This change eliminates global variables like stdout_buffer. Instead we wrap up the IO information into a new struct io_streams_t, and thread that through every builtin. This makes the intent clearer, gives us a place to hang new IO data, and eliminates the ugly global state management like builtin_push_io. --- src/parser.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/parser.h') diff --git a/src/parser.h b/src/parser.h index d7ee0570..13fa6d16 100644 --- a/src/parser.h +++ b/src/parser.h @@ -280,6 +280,9 @@ private: */ const wchar_t *is_function() const; + /* Helper for stack_trace() */ + void stack_trace_internal(size_t block_idx, wcstring *out) const; + public: /** Get the "principal" parser, whatever that is */ @@ -425,9 +428,9 @@ public: const wchar_t *current_filename() const; /** - Write a stack trace starting at the specified block to the specified wcstring + Return a string representing the current stack trace */ - void stack_trace(size_t block_idx, wcstring &buff) const; + wcstring stack_trace() const; }; #endif -- cgit v1.2.3