Skip to content

Commit 48bce92

Browse files
authored
Merge pull request #4012 from tautschnig/json-xml-array-size
type-to-{JSON,XML}: output array size
2 parents 879cb13 + a4c43a7 commit 48bce92

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

src/goto-programs/json_expr.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ json_objectt json(const typet &type, const namespacet &ns, const irep_idt &mode)
156156
{
157157
result["name"] = json_stringt("array");
158158
result["subtype"] = json(to_array_type(type).subtype(), ns, mode);
159+
result["size"] = json(to_array_type(type).size(), ns, mode);
159160
}
160161
else if(type.id() == ID_vector)
161162
{

src/goto-programs/xml_expr.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ xmlt xml(const typet &type, const namespacet &ns)
8080
result.name = "array";
8181
result.new_element("subtype").new_element() =
8282
xml(to_array_type(type).subtype(), ns);
83+
result.new_element("size").new_element() =
84+
xml(to_array_type(type).size(), ns);
8385
}
8486
else if(type.id() == ID_vector)
8587
{

0 commit comments

Comments
 (0)