ctaggart / froto

Froto: F# Protocol Buffers
MIT License
146 stars 27 forks source link

Proto3 oneOf type does not parse #88

Closed 7sharp9 closed 6 years ago

7sharp9 commented 6 years ago

The following definition results in a parse failure:

syntax = "proto3";

message SampleMessage {
    oneof test_oneof {
      string name = 4;
      int32 age = 9;
    }
}
Error in Ln: 4 Col: 22
    oneof test_oneof {
                     ^
Expecting: newline, tab, ' ', '/*', '//' or '='
jhugard commented 6 years ago

The oneof itself parses in isolation; i.e., the pOneOf parser works. Looking into why the above fails. Looks like it fails for proto2 as well.

jhugard commented 6 years ago

Nix that - wrote a bad test (copypasta). Proto2 works, but Proto3 fails. Digging.

7sharp9 commented 6 years ago

Yeah I noticed 2 seemed to work, Im not that familiar with fparsec unfortunately.

jhugard commented 6 years ago

Sorry, can't finish debugging this right now but I do have a failing unit test. Will take a deeper look when I can.