Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vague errors e.g. found { but expected [constant] #21

Closed
xackery opened this issue Jan 14, 2019 · 9 comments
Closed

vague errors e.g. found { but expected [constant] #21

xackery opened this issue Jan 14, 2019 · 9 comments

Comments

@xackery
Copy link

xackery commented Jan 14, 2019

> $GOBIN/pl .
found "{" but expected [constant]

No line numbers or file names when an error is found

@xackery
Copy link
Author

xackery commented Jan 14, 2019

Looks like it dislikes:
string owner_machine_id = 3 [(validator.field) = {regex: "^[A-z0-9-]+$"}];

this is part of https://github.com/mwitkow/go-proto-validators

@yoheimuta
Copy link
Owner

@xackery thanks for the report.

Let me check.

@yoheimuta
Copy link
Owner

@xackery

string owner_machine_id = 3 [(validator.field) = {regex: "^[A-z0-9-]+$"}];

https://github.com/yoheimuta/go-protoparser already supports the option of go-proto-validators.
protolint parses this line well under my environment.

merged #23 with a verbose flag support.

Care to try with -v flag? And if you can please provide me with a reproducible test case, it would be much appreciated.

@aLekSer
Copy link

aLekSer commented Jun 12, 2019

I got this bug on this file:
https://github.com/googleforgames/agones/blob/master/sdk.proto

2019/06/12 12:35:04 [DEBUG] Text=[{], Token=[14], Pos=[sdk.proto:27:36] called from lexer.go:127
found "{" but expected [constant] at /Users/alexander/go/src/github.com/yoheimuta/go-protoparser/internal/lexer/constant.go:38                                                                  

Seems to could not parse option (google.api.http) = {:


service SDK {
    // Call when the GameServer is ready
    rpc Ready (Empty) returns (Empty) {
        option (google.api.http) = {
            post: "/ready"
            body: "*"
        };
    }
...
}

@yoheimuta
Copy link
Owner

@aLekSer Thank you very much for the report.
I will investigate it soon.

@yoheimuta
Copy link
Owner

@aLekSer I understand the issue. I will first fix yoheimuta/go-protoparser#22.

@yoheimuta
Copy link
Owner

@aLekSer #26 fixed this issue.
Could you confirm it's OK?

@aLekSer
Copy link

aLekSer commented Jun 12, 2019

Yes, now it is ok, and option () = {} got parsed well.

@yoheimuta
Copy link
Owner

Thanks for confirming!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants