Handle +/-inf in protos (#7256)

* Handle +/-inf in protos

* Check for digit in 4th pos
This commit is contained in:
Derek Bailey
2022-04-19 13:07:26 -07:00
committed by GitHub
parent 7bcd857b87
commit ccfb4c20bf
8 changed files with 48 additions and 8 deletions

View File

@@ -51,6 +51,9 @@ table ProtoMessage {
/// doc comment for r.
r:proto.test.ProtoMessage_.Anonymous0;
outer_enum:proto.test.ProtoEnum;
u:float = +inf;
v:float = +inf;
w:float = -inf;
}
namespace proto.test.ProtoMessage_;

View File

@@ -67,4 +67,8 @@ message ProtoMessage {
OtherMessage t = 18;
}
optional ProtoEnum outer_enum = 33;
// Tests that `inf` and `+/-inf` can be parsed in proto options.
optional float u = 34 [default = inf];
optional float v = 35 [default = +inf];
optional float w = 36 [default = -inf];
}

View File

@@ -49,6 +49,9 @@ table ProtoMessage {
/// doc comment for r.
r:proto.test.ProtoMessage_.Anonymous0;
outer_enum:proto.test.ProtoEnum;
u:float = +inf;
v:float = +inf;
w:float = -inf;
}
namespace proto.test.ProtoMessage_;

View File

@@ -51,6 +51,9 @@ table ProtoMessage {
/// doc comment for r.
r:proto.test.test_namespace_suffix.ProtoMessage_.Anonymous0;
outer_enum:proto.test.test_namespace_suffix.ProtoEnum;
u:float = +inf;
v:float = +inf;
w:float = -inf;
}
namespace proto.test.test_namespace_suffix.ProtoMessage_;

View File

@@ -61,6 +61,9 @@ table ProtoMessage {
/// doc comment for r.
r:proto.test.ProtoMessage_.RUnion;
outer_enum:proto.test.ProtoEnum;
u:float = +inf;
v:float = +inf;
w:float = -inf;
}
namespace proto.test.ProtoMessage_;

View File

@@ -59,6 +59,9 @@ table ProtoMessage {
/// doc comment for r.
r:proto.test.ProtoMessage_.RUnion;
outer_enum:proto.test.ProtoEnum;
u:float = +inf;
v:float = +inf;
w:float = -inf;
}
namespace proto.test.ProtoMessage_;

View File

@@ -61,6 +61,9 @@ table ProtoMessage {
/// doc comment for r.
r:proto.test.test_namespace_suffix.ProtoMessage_.RUnion;
outer_enum:proto.test.test_namespace_suffix.ProtoEnum;
u:float = +inf;
v:float = +inf;
w:float = -inf;
}
namespace proto.test.test_namespace_suffix.ProtoMessage_;