3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-07-27 06:27:57 +00:00

log_help: {add,push,pop}_content helpers

This commit is contained in:
Krystine Sherwin 2025-07-21 10:34:12 +12:00
parent d4498acea7
commit 7d0bcd8b48
No known key found for this signature in database
2 changed files with 19 additions and 10 deletions

View file

@ -78,6 +78,18 @@ private:
int _current_indent = 0;
ContentListing _root_listing;
ContentListing *_current_listing;
void add_content(string type, string body, source_location location) {
_current_listing->add_content(type, body, location);
}
void push_content(string type, string body, source_location location) {
add_content(type, body, location);
_current_listing = _current_listing->content.back();
}
void pop_content() {
_current_listing = _current_listing->parent;
log_assert(_current_listing != nullptr);
}
public:
PrettyHelp(Mode mode = LOG);
~PrettyHelp();