Skip to content
This repository has been archived by the owner on Feb 8, 2022. It is now read-only.

PulsarApi.proto #106

Closed
vilinski opened this issue Aug 12, 2019 · 3 comments
Closed

PulsarApi.proto #106

vilinski opened this issue Aug 12, 2019 · 3 comments
Assignees

Comments

@vilinski
Copy link

vilinski commented Aug 12, 2019

Getting error with the file PulsarApi.proto:

falanx --inputfile PulsarApi.proto --outputfile Pulsar.Proto.fs --defaultnamespace Pulsar.Proto --serializer binary
Generating code for: PulsarApi.proto
ERROR: proto file was not able to be parsed.

Error in Ln: 55 Col: 11
    optional int32 partition = 3;
          ^
Expecting: whitespace

Looks nothing suspect for me on this place:

message MessageIdData {
    required uint64 ledgerId = 1;
    required uint64 entryId  = 2;
    optional int32 partition = 3 [default = -1];
    optional int32 batch_index = 4 [default = -1];
}
@jhugard
Copy link
Collaborator

jhugard commented Aug 13, 2019

Haven't worked this code in forever, but I think the root cause has to do with the core parsing for messages: something was consuming a token and leaving the parser in a bad state.

Can you try PR #107?

jhugard added a commit that referenced this issue Aug 13, 2019
Address issues with parser order, including issue #106 and possibly #93.
Core parser was order dependent on several productions and would confuse a
number of things as message definitions.
Corrected by adding back-tracking on every production in message.
Also fixed running tests when the project path includes a hash symbol, as
in .../F#/...
ctaggart pushed a commit that referenced this issue Aug 16, 2019
Address issues with parser order, including issue #106 and possibly #93.
Core parser was order dependent on several productions and would confuse a
number of things as message definitions.
Corrected by adding back-tracking on every production in message.
Also fixed running tests when the project path includes a hash symbol, as
in .../F#/...
@jhugard jhugard self-assigned this Aug 16, 2019
@jhugard
Copy link
Collaborator

jhugard commented Jun 6, 2021

@vilinski The commit above was included in release 0.7.2. Can you verify the change worked, so that this issue can be closed?

@vilinski
Copy link
Author

vilinski commented Jun 7, 2021

sorry, waited for falanx updates it's deps.

Falanx 0.6.0 still doesn't work with actual PulsarApi.proto with the parser bug on the same line.

❯ falanx --inputfile PulsarApi.proto --outputfile Pulsar.Proto.fs --defaultnamespace Pulsar.Proto --serializer binary

Generating code for: PulsarApi.proto
ERROR: proto file was not able to be parsed.

Error in Ln: 60 Col: 12
     optional int32 partition = 3 [default = -1];
           ^
Expecting: whitespace

But type provider works without errors.

#r "nuget: Froto.TypeProvider"

open Froto.TypeProvider

let [<Literal>] PulsarApiProto = __SOURCE_DIRECTORY__ + "/PulsarApi.proto"
type PulsarApi = ProtocolBuffersTypeProvider<PulsarApiProto>

let msg = PulsarApi.Pulsar.Proto.MessageIdData()
msg.Partition <- Some 42

so not a Froto issue anymore.
Rather falanx still does not include the changes (09.04.2020)

@vilinski vilinski closed this as completed Jun 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants