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

Negative enum values are not recognized #168

Open
roge opened this issue Nov 21, 2023 · 0 comments
Open

Negative enum values are not recognized #168

roge opened this issue Nov 21, 2023 · 0 comments

Comments

@roge
Copy link

roge commented Nov 21, 2023

Negative enum values are not handled correctly for syntax highlighting.

In this example, a negative enum value is preventing the line from being highlighted correctly:

vscode-proto3 not correctly highlighting valid proto3 code with negative enum values

protoc accepts these enum declarations without issue and they are valid per the language specification:

Enum Values

Enums must contain at least one enum value. To enable a predictive parser implementation and avoid ambiguity, an enum value's name cannot be "option" or "reserved".

EnumValueDecl = EnumValueName equals EnumValueNumber [ CompactOptions ] semicolon .

EnumValueName   = identifier  - ( option | reserved ) .
EnumValueNumber = [ minus ] int_literal .

Examples

JOB_STATE_UNSET = 0;
NEGATIVE = -1;
UNKNOWN = 12 [deprecated = true];
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