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

"Error: illegal token '3', '=' expected" for reserved field in enum #949

Closed
ccdunder opened this issue Nov 27, 2017 · 1 comment
Closed

Comments

@ccdunder
Copy link
Contributor

protobuf.js version: 6.8.0 and master

Actual: The following proto fails to parse.
Expected: The following proto parses successfully.

message Foo {
  enum Status {
    UNKNOWN = 0;
    TRUE = 1;
    FALSE = 2;

    reserved 3;
    reserved "bar";
  }
  ...
}
Error: illegal token '3', '=' expected (line 7)                                
    at illegal (protobufjs/src/tokenize.js:121:16)
    at skip (protobufjs/src/tokenize.js:292:19)
    at parseEnumValue (protobufjs/src/parse.js:500:9)
    at parseEnum_block (protobufjs/src/parse.js:489:17)
    at ifBlock (protobufjs/src/parse.js:279:17)
    at parseEnum (protobufjs/src/parse.js:484:9)
    at parseCommon (protobufjs/src/parse.js:256:17)
    at parseType_block (protobufjs/src/parse.js:298:17)
    at ifBlock (protobufjs/src/parse.js:279:17)
    at parseType (protobufjs/src/parse.js:297:9) 
@ccdunder
Copy link
Contributor Author

Thanks!

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

1 participant