This parser throws an error when an enum value is written in hexadecimal instead of decimal. Here is a simple test case:
from proto_schema_parser.parser import Parser
text = """
syntax = "proto2";
enum some_enum {
SOME_VALUE = 0xC8;
}
"""
result = Parser().parse(text)
And the error:
File "/home/.../lib/python3.12/site-packages/proto_schema_parser/parser.py", line 176, in visitEnumValueDecl
number = int(self._getText(ctx.enumValueNumber()))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: '0xC8'
The included protobuf code compiles fine with the first-party protobuf compiler.
Hi,
This parser throws an error when an enum value is written in hexadecimal instead of decimal. Here is a simple test case:
And the error:
The included protobuf code compiles fine with the first-party protobuf compiler.