Open mingodad opened 10 months ago
Oh that's cool, I looked the other day and it wasn't working but now it is! Very neat :)
I just found an example that this grammar doesn't seem to accept in https://github.com/electric-sql/electric/blob/main/protocol/satellite.proto :
enum SatAuthHeader {
reserved 1;
// Required by the Protobuf spec.
UNSPECIFIED = 0;
}
There is no rule to accept reserved 1;
.
Changing the grammar like this seems to fix the problem:
enum_body_content :
option
| enum_value
| reserved //<<< adding this rule
;
See documentation here https://protobuf.dev/programming-guides/proto3/#reserved
The above can be tested on https://mingodad.github.io/parsertl-playground/playground/ :+1:
I've just added this project grammar to https://mingodad.github.io/parsertl-playground/playground/ (select
Protobuf3 parser
under examples then clickParse
to see the parser tree).I hope it can help develop/debug/extend/test/document the grammar used in this project.
I did some changes there:
proto_content : * proto
removed and addedproto_content_oom
)Any feedback is welcome !