Skip to content

Commit 4b789bf

Browse files
committed
format_type can now format range_typet
This adds formatting for range_typet as { from, ..., to }.
1 parent 4c59d28 commit 4b789bf

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/util/format_type.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,12 @@ std::ostream &format_rec(std::ostream &os, const typet &type)
9898
return os << "\xe2\x84\xa4"; // u+2124, 'Z'
9999
else if(id == ID_natural)
100100
return os << "\xe2\x84\x95"; // u+2115, 'N'
101+
else if(id == ID_range)
102+
{
103+
auto &range_type = to_range_type(type);
104+
return os << "{ " << range_type.get_from() << ", ..., "
105+
<< range_type.get_to() << " }";
106+
}
101107
else if(id == ID_rational)
102108
return os << "\xe2\x84\x9a"; // u+211A, 'Q'
103109
else if(id == ID_mathematical_function)

unit/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ SRC += analyses/ai/ai.cpp \
144144
util/format.cpp \
145145
util/format_expr.cpp \
146146
util/format_number_range.cpp \
147+
util/format_type.cpp \
147148
util/get_base_name.cpp \
148149
util/graph.cpp \
149150
util/help_formatter.cpp \

0 commit comments

Comments
 (0)