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:
parent
d4498acea7
commit
7d0bcd8b48
2 changed files with 19 additions and 10 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue