Commit 87e04952 authored by Kenton Varda's avatar Kenton Varda

Don't double-parenthesize struct-typed annotations.

parent 9a28ac31
......@@ -291,8 +291,12 @@ private:
KJ_REQUIRE(proto.isAnnotation());
auto annDecl = proto.getAnnotation();
return kj::strTree(prefix, "$", nodeName(decl, scope), "(",
genValue(annDecl.getType(), annotation.getValue(), decl), ")", suffix);
auto value = genValue(annDecl.getType(), annotation.getValue(), decl).flatten();
if (value.startsWith("(")) {
return kj::strTree(prefix, "$", nodeName(decl, scope), value, suffix);
} else {
return kj::strTree(prefix, "$", nodeName(decl, scope), "(", value, ")", suffix);
}
}
kj::StringTree genAnnotations(List<schema::Annotation>::Reader list, Schema scope) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment