Syntax for custom errors.

This commit is contained in:
chriseth
2021-03-30 21:15:18 +02:00
parent 510bbaf672
commit b04b189959
70 changed files with 629 additions and 47 deletions
+11
View File
@@ -481,6 +481,17 @@ bool ASTJsonConverter::visit(EventDefinition const& _node)
return false;
}
bool ASTJsonConverter::visit(ErrorDefinition const& _node)
{
setJsonNode(_node, "ErrorDefinition", {
make_pair("name", _node.name()),
make_pair("nameLocation", sourceLocationToString(_node.nameLocation())),
make_pair("documentation", _node.documentation() ? toJson(*_node.documentation()) : Json::nullValue),
make_pair("parameters", toJson(_node.parameterList()))
});
return false;
}
bool ASTJsonConverter::visit(ElementaryTypeName const& _node)
{
std::vector<pair<string, Json::Value>> attributes = {