Commit 63573705 authored by Kenton Varda's avatar Kenton Varda

Follow style guide.

parent 3f5d9815
......@@ -1383,8 +1383,7 @@ NodeTranslator::NodeTranslator(
compileNode(decl, wipNode.get());
}
void NodeTranslator::addFieldDoc(uint codeOrder, ::capnp::Text::Reader docComment)
{
void NodeTranslator::addFieldDoc(uint codeOrder, ::capnp::Text::Reader docComment) {
fieldDocs.add(std::make_pair(codeOrder, docComment));
}
......@@ -1478,8 +1477,9 @@ void NodeTranslator::compileNode(Declaration::Reader decl, schema::Node::Builder
if (decl.hasDocComment() || !fieldDocs.empty()) {
Orphan<schema::NodeDoc> doc = orphanage.newOrphan<schema::NodeDoc>();
doc.get().setId(wipNode.getReader().getId());
if (decl.hasDocComment())
if (decl.hasDocComment()) {
doc.get().setDocComment(decl.getDocComment());
}
if (!fieldDocs.empty()) {
auto fdocs = doc.get().initFieldDocs(fieldDocs.size());
......@@ -1841,9 +1841,10 @@ private:
hasDefaultValue = true;
fieldDefaultValue = fieldDecl.getDefaultValue().getValue();
}
if (decl.hasDocComment())
if (decl.hasDocComment()) {
docComment = decl.getDocComment();
}
}
inline MemberInfo(MemberInfo& parent, uint codeOrder,
const Declaration::Param::Reader& decl,
StructLayout::StructOrGroup& fieldScope,
......@@ -1869,9 +1870,10 @@ private:
startByte(decl.getStartByte()), endByte(decl.getEndByte()),
node(node), unionScope(nullptr) {
KJ_REQUIRE(decl.which() != Declaration::FIELD);
if (decl.hasDocComment())
if (decl.hasDocComment()) {
docComment = decl.getDocComment();
}
}
schema::Field::Builder getSchema() {
KJ_IF_MAYBE(result, schema) {
......
......@@ -181,7 +181,9 @@ private:
Orphan<schema::Node> wipNode;
kj::Maybe<Orphan<schema::NodeDoc>> wipNodeDoc;
// The work-in-progress schema node and its docstring
kj::Vector<std::pair<uint, ::capnp::Text::Reader>> fieldDocs;
// TODO(now): Don't use std::pair.
kj::Vector<Orphan<schema::Node>> groups;
// If this is a struct node and it contains groups, these are the nodes for those groups, which
......
......@@ -1863,8 +1863,7 @@ kj::Array<schema::NodeDoc::Reader> SchemaLoader::Impl::getAllDocs() const {
return result;
}
void SchemaLoader::Impl::loadDoc(schema::NodeDoc::Reader docReader)
{
void SchemaLoader::Impl::loadDoc(schema::NodeDoc::Reader docReader) {
docs[docReader.getId()] = docReader;
}
......
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