Skip to content

Commit ef65118

Browse files
committed
format_expr now formats array_of_exprt
This adds a formatter to format_expr for array_of_exprt expressions.
1 parent 1b5507f commit ef65118

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/util/format_expr.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,12 @@ void format_expr_configt::setup()
456456
expr_map[ID_array] = compound;
457457
expr_map[ID_struct] = compound;
458458

459+
expr_map[ID_array_of] =
460+
[](std::ostream &os, const exprt &expr) -> std::ostream & {
461+
const auto &array_of_expr = to_array_of_expr(expr);
462+
return os << "array_of(" << format(array_of_expr.what()) << ')';
463+
};
464+
459465
expr_map[ID_if] = [](std::ostream &os, const exprt &expr) -> std::ostream & {
460466
const auto &if_expr = to_if_expr(expr);
461467
return os << '(' << format(if_expr.cond()) << " ? "

0 commit comments

Comments
 (0)