summaryrefslogtreecommitdiffstats
path: root/src/pretty_printer.hh
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/pretty_printer.hh18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/pretty_printer.hh b/src/pretty_printer.hh
index f10b946..495eb4e 100644
--- a/src/pretty_printer.hh
+++ b/src/pretty_printer.hh
@@ -31,19 +31,16 @@
#define pretty_printer_hh
#include <deque>
-#include <map>
#include <sstream>
#include <stack>
-#include <utility>
+#include <string>
#include <vector>
-#include <sys/types.h>
-
#include "base/attr_line.hh"
#include "base/file_range.hh"
-#include "base/opt_util.hh"
#include "data_scanner.hh"
#include "document.sections.hh"
+#include "optional.hpp"
class pretty_printer {
public:
@@ -97,16 +94,18 @@ public:
return std::move(this->pp_hier_stage);
}
+ std::set<size_t> take_indents() { return std::move(this->pp_indents); }
+
private:
- void descend();
+ void descend(data_token_t dt);
- void ascend();
+ void ascend(data_token_t dt);
void start_new_line();
bool flush_values(bool start_on_depth = false);
- void append_indent();
+ int append_indent();
void write_element(const element& el);
@@ -121,9 +120,11 @@ private:
int pp_depth{0};
int pp_line_length{0};
int pp_soft_indent{0};
+ std::vector<data_token_t> pp_container_tokens{};
std::stack<int> pp_body_lines{};
data_scanner* pp_scanner;
string_attrs_t pp_attrs;
+ string_attrs_t pp_post_attrs;
std::ostringstream pp_stream;
std::deque<element> pp_values{};
int pp_shift_accum{0};
@@ -132,6 +133,7 @@ private:
std::vector<lnav::document::section_interval_t> pp_intervals;
std::vector<std::unique_ptr<lnav::document::hier_node>> pp_hier_nodes;
std::unique_ptr<lnav::document::hier_node> pp_hier_stage;
+ std::set<size_t> pp_indents;
};
#endif