Commit 29b2e0c4 authored by Kenton Varda's avatar Kenton Varda

Merge pull request #310 from sandstorm-io/revert-302-master

Revert "Propagate DocComments into binary schema"
parents 4fe6c1fe c78d7c44
......@@ -1428,9 +1428,6 @@ void NodeTranslator::compileNode(Declaration::Reader decl, schema::Node::Builder
}
builder.adoptAnnotations(compileAnnotationApplications(decl.getAnnotations(), targetsFlagName));
if (decl.hasDocComment())
builder.setDocComment(decl.getDocComment());
}
static kj::StringPtr getExpressionTargetName(Expression::Reader exp) {
......@@ -1743,8 +1740,6 @@ private:
// Information about the field declaration. We don't use Declaration::Reader because it might
// have come from a Declaration::Param instead.
kj::Maybe<::capnp::Text::Reader> docComment = nullptr;
kj::Maybe<schema::Field::Builder> schema;
// Schema for the field. Initialized when getSchema() is first called.
......@@ -1781,8 +1776,6 @@ private:
hasDefaultValue = true;
fieldDefaultValue = fieldDecl.getDefaultValue().getValue();
}
if (decl.hasDocComment())
docComment = decl.getDocComment();
}
inline MemberInfo(MemberInfo& parent, uint codeOrder,
const Declaration::Param::Reader& decl,
......@@ -1809,8 +1802,6 @@ private:
startByte(decl.getStartByte()), endByte(decl.getEndByte()),
node(node), unionScope(nullptr) {
KJ_REQUIRE(decl.which() != Declaration::FIELD);
if (decl.hasDocComment())
docComment = decl.getDocComment();
}
schema::Field::Builder getSchema() {
......@@ -1824,9 +1815,6 @@ private:
}
builder.setName(name);
builder.setCodeOrder(codeOrder);
KJ_IF_MAYBE(docCommentReal, docComment) {
builder.setDocComment(*docCommentReal);
}
schema = builder;
return builder;
}
......
......@@ -77,9 +77,6 @@ struct Node {
annotations @5 :List(Annotation);
# Annotations applied to this node.
docComment @34 :Text;
# This line, but on a node not on a Field...
union {
# Info specific to each kind of node.
......@@ -189,9 +186,6 @@ struct Field {
annotations @2 :List(Annotation);
docComment @11 :Text;
# This line.
const noDiscriminant :UInt16 = 0xffff;
discriminantValue @3 :UInt16 = Field.noDiscriminant;
......
This diff is collapsed.
......@@ -89,7 +89,7 @@ struct Node {
struct Annotation;
struct _capnpPrivate {
CAPNP_DECLARE_STRUCT_HEADER(e682ab4cf923a417, 5, 7)
CAPNP_DECLARE_STRUCT_HEADER(e682ab4cf923a417, 5, 6)
#if !CAPNP_LITE
static constexpr ::capnp::_::RawBrandedSchema const* brand = &schema->defaultBrand;
#endif // !CAPNP_LITE
......@@ -134,7 +134,7 @@ struct Node::Struct {
class Pipeline;
struct _capnpPrivate {
CAPNP_DECLARE_STRUCT_HEADER(9ea0b19b37fb4435, 5, 7)
CAPNP_DECLARE_STRUCT_HEADER(9ea0b19b37fb4435, 5, 6)
#if !CAPNP_LITE
static constexpr ::capnp::_::RawBrandedSchema const* brand = &schema->defaultBrand;
#endif // !CAPNP_LITE
......@@ -149,7 +149,7 @@ struct Node::Enum {
class Pipeline;
struct _capnpPrivate {
CAPNP_DECLARE_STRUCT_HEADER(b54ab3364333f598, 5, 7)
CAPNP_DECLARE_STRUCT_HEADER(b54ab3364333f598, 5, 6)
#if !CAPNP_LITE
static constexpr ::capnp::_::RawBrandedSchema const* brand = &schema->defaultBrand;
#endif // !CAPNP_LITE
......@@ -164,7 +164,7 @@ struct Node::Interface {
class Pipeline;
struct _capnpPrivate {
CAPNP_DECLARE_STRUCT_HEADER(e82753cff0c2218f, 5, 7)
CAPNP_DECLARE_STRUCT_HEADER(e82753cff0c2218f, 5, 6)
#if !CAPNP_LITE
static constexpr ::capnp::_::RawBrandedSchema const* brand = &schema->defaultBrand;
#endif // !CAPNP_LITE
......@@ -179,7 +179,7 @@ struct Node::Const {
class Pipeline;
struct _capnpPrivate {
CAPNP_DECLARE_STRUCT_HEADER(b18aa5ac7a0d9420, 5, 7)
CAPNP_DECLARE_STRUCT_HEADER(b18aa5ac7a0d9420, 5, 6)
#if !CAPNP_LITE
static constexpr ::capnp::_::RawBrandedSchema const* brand = &schema->defaultBrand;
#endif // !CAPNP_LITE
......@@ -194,7 +194,7 @@ struct Node::Annotation {
class Pipeline;
struct _capnpPrivate {
CAPNP_DECLARE_STRUCT_HEADER(ec1619d4400a0290, 5, 7)
CAPNP_DECLARE_STRUCT_HEADER(ec1619d4400a0290, 5, 6)
#if !CAPNP_LITE
static constexpr ::capnp::_::RawBrandedSchema const* brand = &schema->defaultBrand;
#endif // !CAPNP_LITE
......@@ -217,7 +217,7 @@ struct Field {
struct Ordinal;
struct _capnpPrivate {
CAPNP_DECLARE_STRUCT_HEADER(9aad50a41f4af45f, 3, 5)
CAPNP_DECLARE_STRUCT_HEADER(9aad50a41f4af45f, 3, 4)
#if !CAPNP_LITE
static constexpr ::capnp::_::RawBrandedSchema const* brand = &schema->defaultBrand;
#endif // !CAPNP_LITE
......@@ -232,7 +232,7 @@ struct Field::Slot {
class Pipeline;
struct _capnpPrivate {
CAPNP_DECLARE_STRUCT_HEADER(c42305476bb4746f, 3, 5)
CAPNP_DECLARE_STRUCT_HEADER(c42305476bb4746f, 3, 4)
#if !CAPNP_LITE
static constexpr ::capnp::_::RawBrandedSchema const* brand = &schema->defaultBrand;
#endif // !CAPNP_LITE
......@@ -247,7 +247,7 @@ struct Field::Group {
class Pipeline;
struct _capnpPrivate {
CAPNP_DECLARE_STRUCT_HEADER(cafccddb68db1d11, 3, 5)
CAPNP_DECLARE_STRUCT_HEADER(cafccddb68db1d11, 3, 4)
#if !CAPNP_LITE
static constexpr ::capnp::_::RawBrandedSchema const* brand = &schema->defaultBrand;
#endif // !CAPNP_LITE
......@@ -266,7 +266,7 @@ struct Field::Ordinal {
};
struct _capnpPrivate {
CAPNP_DECLARE_STRUCT_HEADER(bb90d5c287870be6, 3, 5)
CAPNP_DECLARE_STRUCT_HEADER(bb90d5c287870be6, 3, 4)
#if !CAPNP_LITE
static constexpr ::capnp::_::RawBrandedSchema const* brand = &schema->defaultBrand;
#endif // !CAPNP_LITE
......@@ -706,9 +706,6 @@ public:
inline bool getIsGeneric() const;
inline bool hasDocComment() const;
inline ::capnp::Text::Reader getDocComment() const;
private:
::capnp::_::StructReader _reader;
template <typename, ::capnp::Kind>
......@@ -802,13 +799,6 @@ public:
inline bool getIsGeneric();
inline void setIsGeneric(bool value);
inline bool hasDocComment();
inline ::capnp::Text::Builder getDocComment();
inline void setDocComment( ::capnp::Text::Reader value);
inline ::capnp::Text::Builder initDocComment(unsigned int size);
inline void adoptDocComment(::capnp::Orphan< ::capnp::Text>&& value);
inline ::capnp::Orphan< ::capnp::Text> disownDocComment();
private:
::capnp::_::StructBuilder _builder;
template <typename, ::capnp::Kind>
......@@ -1556,9 +1546,6 @@ public:
inline Ordinal::Reader getOrdinal() const;
inline bool hasDocComment() const;
inline ::capnp::Text::Reader getDocComment() const;
private:
::capnp::_::StructReader _reader;
template <typename, ::capnp::Kind>
......@@ -1619,13 +1606,6 @@ public:
inline Ordinal::Builder getOrdinal();
inline Ordinal::Builder initOrdinal();
inline bool hasDocComment();
inline ::capnp::Text::Builder getDocComment();
inline void setDocComment( ::capnp::Text::Reader value);
inline ::capnp::Text::Builder initDocComment(unsigned int size);
inline void adoptDocComment(::capnp::Orphan< ::capnp::Text>&& value);
inline ::capnp::Orphan< ::capnp::Text> disownDocComment();
private:
::capnp::_::StructBuilder _builder;
template <typename, ::capnp::Kind>
......@@ -4353,38 +4333,6 @@ inline void Node::Builder::setIsGeneric(bool value) {
288 * ::capnp::ELEMENTS, value);
}
inline bool Node::Reader::hasDocComment() const {
return !_reader.getPointerField(6 * ::capnp::POINTERS).isNull();
}
inline bool Node::Builder::hasDocComment() {
return !_builder.getPointerField(6 * ::capnp::POINTERS).isNull();
}
inline ::capnp::Text::Reader Node::Reader::getDocComment() const {
return ::capnp::_::PointerHelpers< ::capnp::Text>::get(
_reader.getPointerField(6 * ::capnp::POINTERS));
}
inline ::capnp::Text::Builder Node::Builder::getDocComment() {
return ::capnp::_::PointerHelpers< ::capnp::Text>::get(
_builder.getPointerField(6 * ::capnp::POINTERS));
}
inline void Node::Builder::setDocComment( ::capnp::Text::Reader value) {
::capnp::_::PointerHelpers< ::capnp::Text>::set(
_builder.getPointerField(6 * ::capnp::POINTERS), value);
}
inline ::capnp::Text::Builder Node::Builder::initDocComment(unsigned int size) {
return ::capnp::_::PointerHelpers< ::capnp::Text>::init(
_builder.getPointerField(6 * ::capnp::POINTERS), size);
}
inline void Node::Builder::adoptDocComment(
::capnp::Orphan< ::capnp::Text>&& value) {
::capnp::_::PointerHelpers< ::capnp::Text>::adopt(
_builder.getPointerField(6 * ::capnp::POINTERS), kj::mv(value));
}
inline ::capnp::Orphan< ::capnp::Text> Node::Builder::disownDocComment() {
return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(
_builder.getPointerField(6 * ::capnp::POINTERS));
}
inline bool Node::Parameter::Reader::hasName() const {
return !_reader.getPointerField(0 * ::capnp::POINTERS).isNull();
}
......@@ -5116,38 +5064,6 @@ inline Field::Ordinal::Builder Field::Builder::initOrdinal() {
_builder.setDataField< ::uint16_t>(6 * ::capnp::ELEMENTS, 0);
return Field::Ordinal::Builder(_builder);
}
inline bool Field::Reader::hasDocComment() const {
return !_reader.getPointerField(4 * ::capnp::POINTERS).isNull();
}
inline bool Field::Builder::hasDocComment() {
return !_builder.getPointerField(4 * ::capnp::POINTERS).isNull();
}
inline ::capnp::Text::Reader Field::Reader::getDocComment() const {
return ::capnp::_::PointerHelpers< ::capnp::Text>::get(
_reader.getPointerField(4 * ::capnp::POINTERS));
}
inline ::capnp::Text::Builder Field::Builder::getDocComment() {
return ::capnp::_::PointerHelpers< ::capnp::Text>::get(
_builder.getPointerField(4 * ::capnp::POINTERS));
}
inline void Field::Builder::setDocComment( ::capnp::Text::Reader value) {
::capnp::_::PointerHelpers< ::capnp::Text>::set(
_builder.getPointerField(4 * ::capnp::POINTERS), value);
}
inline ::capnp::Text::Builder Field::Builder::initDocComment(unsigned int size) {
return ::capnp::_::PointerHelpers< ::capnp::Text>::init(
_builder.getPointerField(4 * ::capnp::POINTERS), size);
}
inline void Field::Builder::adoptDocComment(
::capnp::Orphan< ::capnp::Text>&& value) {
::capnp::_::PointerHelpers< ::capnp::Text>::adopt(
_builder.getPointerField(4 * ::capnp::POINTERS), kj::mv(value));
}
inline ::capnp::Orphan< ::capnp::Text> Field::Builder::disownDocComment() {
return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(
_builder.getPointerField(4 * ::capnp::POINTERS));
}
inline ::uint32_t Field::Slot::Reader::getOffset() const {
return _reader.getDataField< ::uint32_t>(
1 * ::capnp::ELEMENTS);
......
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