Skip to content

Commit 6d54f18

Browse files
author
martin
committed
Improve the structured output in --xml output mode
1 parent a319e23 commit 6d54f18

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/goto-analyzer/static_verifier.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Author: Martin Brain, [email protected]
1313
#include <util/namespace.h>
1414
#include <util/options.h>
1515
#include <util/range.h>
16+
#include <util/xml_irep.h>
1617

1718
#include <goto-programs/goto_model.h>
1819

@@ -70,8 +71,16 @@ struct static_verifier_resultt
7071
xmlt x("result");
7172

7273
x.set_attribute("status", message(this->status));
74+
75+
// DEPRECATED(SINCE(2020, 12, 2, "Remove and use the structured version"));
76+
// Unstructed partial output of source location is not great...
7377
x.set_attribute("file", id2string(this->source_location.get_file()));
7478
x.set_attribute("line", id2string(this->source_location.get_line()));
79+
80+
// ... this is better
81+
x.new_element(xml(source_location));
82+
83+
// ( get_comment is not output as part of xml(source_location) )
7584
x.set_attribute(
7685
"description", id2string(this->source_location.get_comment()));
7786

0 commit comments

Comments
 (0)