Commit ab3fc0e6 authored by Kenton Varda's avatar Kenton Varda

Fix capnpc-capnp.c++, which appears to have rotted (issue 15). Should probably…

Fix capnpc-capnp.c++, which appears to have rotted (issue 15).  Should probably write a test at some point...
parent 600ddee8
...@@ -41,7 +41,7 @@ class TextBlob { ...@@ -41,7 +41,7 @@ class TextBlob {
public: public:
TextBlob() = default; TextBlob() = default;
template <typename... Params> template <typename... Params>
TextBlob(Params&&... params); explicit TextBlob(Params&&... params);
TextBlob(kj::Array<TextBlob>&& params); TextBlob(kj::Array<TextBlob>&& params);
void writeTo(kj::OutputStream& out) const; void writeTo(kj::OutputStream& out) const;
...@@ -64,8 +64,8 @@ private: ...@@ -64,8 +64,8 @@ private:
void fill(char* textPos, Branch* branchesPos, TextBlob&& first, Rest&&... rest); void fill(char* textPos, Branch* branchesPos, TextBlob&& first, Rest&&... rest);
template <typename T> template <typename T>
auto toContainer(T&& t) -> decltype(kj::toCharSequence(kj::fwd(t))) { auto toContainer(T&& t) -> decltype(kj::toCharSequence(kj::fwd<T>(t))) {
return kj::toCharSequence(kj::fwd(t)); return kj::toCharSequence(kj::fwd<T>(t));
} }
TextBlob&& toContainer(TextBlob&& t) { TextBlob&& toContainer(TextBlob&& t) {
return kj::mv(t); return kj::mv(t);
...@@ -203,6 +203,10 @@ struct Indent { ...@@ -203,6 +203,10 @@ struct Indent {
inline Iterator end() const { return Iterator(amount); } inline Iterator end() const { return Iterator(amount); }
}; };
inline Indent KJ_STRINGIFY(const Indent& indent) {
return indent;
}
// ======================================================================================= // =======================================================================================
SchemaLoader schemaLoader; SchemaLoader schemaLoader;
...@@ -390,7 +394,7 @@ TextBlob genValue(schema::Type::Reader type, schema::Value::Reader value, Schema ...@@ -390,7 +394,7 @@ TextBlob genValue(schema::Type::Reader type, schema::Value::Reader value, Schema
return text(""); return text("");
} }
} }
return 0; return text("");
} }
TextBlob genAnnotation(schema::Annotation::Reader annotation, TextBlob genAnnotation(schema::Annotation::Reader annotation,
......
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