Commit e9481681 authored by Kenton Varda's avatar Kenton Varda

Merge pull request #62 from jmspiewak/master

Fix missing annotations
parents 4f4c5a01 6e26bb68
...@@ -416,7 +416,8 @@ private: ...@@ -416,7 +416,8 @@ private:
proto.getName(), " :", genType(slot.getType(), interface), proto.getName(), " :", genType(slot.getType(), interface),
isEmptyValue(slot.getDefaultValue()) ? kj::strTree("") : isEmptyValue(slot.getDefaultValue()) ? kj::strTree("") :
kj::strTree(" = ", genValue( kj::strTree(" = ", genValue(
slot.getType(), slot.getDefaultValue(), interface))); slot.getType(), slot.getDefaultValue(), interface)),
genAnnotations(proto.getAnnotations(), interface));
}, ", "), ")"); }, ", "), ")");
} else { } else {
return nodeName(schema, interface); return nodeName(schema, interface);
...@@ -472,7 +473,8 @@ private: ...@@ -472,7 +473,8 @@ private:
auto results = schemaLoader.get(methodProto.getResultStructType()).asStruct(); auto results = schemaLoader.get(methodProto.getResultStructType()).asStruct();
return kj::strTree( return kj::strTree(
indent.next(), methodProto.getName(), " @", method.getIndex(), " ", indent.next(), methodProto.getName(), " @", method.getIndex(), " ",
genParamList(interface, params), " -> ", genParamList(interface, results), ";\n"); genParamList(interface, params), " -> ", genParamList(interface, results),
genAnnotations(methodProto.getAnnotations(), interface), ";\n");
}, },
genNestedDecls(schema, indent.next()), genNestedDecls(schema, indent.next()),
indent, "}\n"); indent, "}\n");
...@@ -482,7 +484,8 @@ private: ...@@ -482,7 +484,8 @@ private:
return kj::strTree( return kj::strTree(
indent, "const ", name, " @0x", kj::hex(proto.getId()), " :", indent, "const ", name, " @0x", kj::hex(proto.getId()), " :",
genType(constProto.getType(), schema), " = ", genType(constProto.getType(), schema), " = ",
genValue(constProto.getType(), constProto.getValue(), schema), ";\n"); genValue(constProto.getType(), constProto.getValue(), schema),
genAnnotations(schema), ";\n");
} }
case schema::Node::ANNOTATION: { case schema::Node::ANNOTATION: {
auto annotationProto = proto.getAnnotation(); auto annotationProto = proto.getAnnotation();
......
...@@ -1295,7 +1295,7 @@ private: ...@@ -1295,7 +1295,7 @@ private:
} }
} }
builder.adoptAnnotations(translator.compileAnnotationApplications( member->getSchema().adoptAnnotations(translator.compileAnnotationApplications(
member->declAnnotations, targetsFlagName)); member->declAnnotations, targetsFlagName));
} }
......
...@@ -481,7 +481,7 @@ $baz(1); # Annotate the file. ...@@ -481,7 +481,7 @@ $baz(1); # Annotate the file.
struct MyStruct $baz(2) { struct MyStruct $baz(2) {
myField @0 :Text = "default" $baz(3); myField @0 :Text = "default" $baz(3);
myUnion @1 union $baz(4) { myUnion :union $baz(4) {
# ... # ...
} }
} }
...@@ -491,7 +491,7 @@ enum MyEnum $baz(5) { ...@@ -491,7 +491,7 @@ enum MyEnum $baz(5) {
} }
interface MyInterface $baz(7) { interface MyInterface $baz(7) {
myMethod(myParam :Text $baz(9)) :Void $baz(8); myMethod @0 (myParam :Text $baz(9)) -> () $baz(8);
} }
annotation myAnnotation(struct) :Int32 $baz(10); annotation myAnnotation(struct) :Int32 $baz(10);
......
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