Closed sbunce closed 7 years ago
David, My goal is to use gotoc with grpc. Any pointers on what needs to get done are appreciated. Thanks!
Seth
I thought of a problem with this CL. There may be a message called "stream". I'll think about how to handle this.
message stream {}
service Serv {
rpc Foo(stream) returns (stream);
}
I was able to resolve that ambiguity. It now handles the corner case where a message is called "stream". I added a test for it. The code is more complicated but I can't think of a way to make it simpler.
message stream {}
service Foo {
rpc Bar(stream) returns (stream);
}
Yeah, this looks too complicated. There's other parts of the parser that effectively do a token lookahead. I think you can just parse the token, and if it is the literal "stream" then the next token is either the stream's message name or ")". Alternatively, read two tokens (there always has to be at least two left), and it'll either be "stream" and Msg, or Msg and ")".
Also, please squash the commits when you push a new version.
I checked in some garbage by accident. Trying to fix now. Please ignore last commit.
I fixed my bad git push. Sorry for that noise.
I took a look at other parts of the parser where you use p.back(). I refactored this change to use p.back() and a few conditions. I think it's simpler to understand now.
Sorry I've been slow. I'll try to get to it this weekend.
Yes, please just squash and force push. The GH review system is still horrid. I only want to merge a single commit, and this change is small enough to re-review in total each time.
I squashed and force pushed.
Thanks for your patience on this review. I should have noticed that extraneous else branch.
I pushed an updated version.
Merged in 6e9e04d.
Thanks for your contribution!
Add support for client and server streaming.
Example: