Skip to content

Commit 42c54e0

Browse files
authored
Merge pull request #1432 from diffblue/smvlang-element-show
extract smv_parse_treet::modulet::elementt::show
2 parents defc129 + b5f704c commit 42c54e0

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

src/smvlang/smv_parse_tree.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,12 @@ std::string to_string(smv_parse_treet::modulet::elementt::element_typet i)
9797
return "";
9898
}
9999

100+
void smv_parse_treet::modulet::elementt::show(std::ostream &out) const
101+
{
102+
out << " TYPE: " << to_string(element_type) << '\n';
103+
out << " EXPR: " << expr.pretty() << '\n';
104+
}
105+
100106
void smv_parse_treet::show(std::ostream &out) const
101107
{
102108
for(auto &module_it : modules)
@@ -144,9 +150,8 @@ void smv_parse_treet::show(std::ostream &out) const
144150

145151
for(auto &element : module.elements)
146152
{
147-
out << " TYPE: " << to_string(element.element_type) << '\n';
148-
out << " EXPR: " << element.expr.pretty() << '\n';
149-
out << std::endl;
153+
element.show(out);
154+
out << '\n';
150155
}
151156
}
152157
}

src/smvlang/smv_parse_tree.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@ class smv_parse_treet
150150
is_define());
151151
return to_equal_expr(expr);
152152
}
153+
154+
void show(std::ostream &) const;
153155
};
154156

155157
typedef std::list<elementt> element_listt;

0 commit comments

Comments
 (0)