mirror of
https://github.com/google/flatbuffers.git
synced 2026-07-01 05:51:39 +00:00
Added support for imports and many other .proto features.
Change-Id: I6600021b7ec8c486794349511232c3e604421c5b Tested: on Linux.
This commit is contained in:
5
tests/prototest/imported.proto
Normal file
5
tests/prototest/imported.proto
Normal file
@@ -0,0 +1,5 @@
|
||||
package proto.test;
|
||||
|
||||
message ImportedMessage {
|
||||
optional int32 a = 26;
|
||||
}
|
||||
@@ -1,14 +1,22 @@
|
||||
// Generated from test.proto
|
||||
|
||||
namespace proto.test;
|
||||
namespace _proto._test;
|
||||
|
||||
/// Enum doc comment.
|
||||
enum ProtoEnum : short {
|
||||
enum ProtoEnum : int {
|
||||
FOO = 1,
|
||||
/// Enum 2nd value doc comment misaligned.
|
||||
BAR = 5,
|
||||
}
|
||||
|
||||
namespace _proto._test;
|
||||
|
||||
table ImportedMessage {
|
||||
a:int;
|
||||
}
|
||||
|
||||
namespace _proto._test;
|
||||
|
||||
/// 2nd table doc comment with
|
||||
/// many lines.
|
||||
table ProtoMessage {
|
||||
@@ -29,10 +37,13 @@ table ProtoMessage {
|
||||
/// lines
|
||||
l:string (required);
|
||||
m:string;
|
||||
n:OtherMessage;
|
||||
n:_proto._test._ProtoMessage.OtherMessage;
|
||||
o:[string];
|
||||
z:_proto._test.ImportedMessage;
|
||||
}
|
||||
|
||||
namespace _proto._test._ProtoMessage;
|
||||
|
||||
table OtherMessage {
|
||||
a:double;
|
||||
/// doc comment for b.
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
// Sample .proto file that we can translate to the corresponding .fbs.
|
||||
|
||||
package proto.test;
|
||||
|
||||
option some_option = is_ignored;
|
||||
import "some_other_schema.proto";
|
||||
import "imported.proto";
|
||||
|
||||
package proto.test;
|
||||
|
||||
/// Enum doc comment.
|
||||
enum ProtoEnum {
|
||||
@@ -41,4 +41,5 @@ message ProtoMessage {
|
||||
optional bytes m = 11;
|
||||
optional OtherMessage n = 12;
|
||||
repeated string o = 14;
|
||||
optional ImportedMessage z = 16;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user