Comments (4)
hmm, yep. the word type
is a reserved keyword, this breaks parsing, it can't be used as a message field's name.
But I think this word "type" is a very common word, so I decided to solve this.
A newer version of bitproto, v0.4.2 was just uploaded, which fixed this problem.
Now the following message parses well:
message Test {
uint4 type = 1 // it's ok now
}
You can upgrade bitproto via pip install -U bitproto
.
https://github.com/hit9/bitproto/releases/tag/v0.4.2
from bitproto.
@g-berthiaume
Hi ~
Yeah, there is a name collision mistake.
type
is a keyword like what the keyword typedef
does in C. Example here
Use like:
type Timestamp = int64;
it will fix:
proto mytest
enum payload_data_type_e: uint8 {
PAYLOAD_DATA_TYPE_UNKNOWN = 1
PAYLOAD_DATA_TYPE_DETECTOR = 2
}
message payload_data_t {
payload_data_type_e data = 1
}
from bitproto.
Interesting ! As I'm starting to work on a basic compiler, I can appreciate the complexity of those kinds of bugs.
Thanks for your work!
On another note:
For some reason, I'm having difficulty updating: Pip raise the following exception:
FileNotFoundError: [Errno 2] No such file or directory: '../README.rst'
Is it possible that the package builder executes setup.py
outside of the compiler/
directory?
Maybe it's a problem with my machine ^^
from bitproto.
@g-berthiaume Thanks for reporting this bug.
pip install -U bitproto
would work now.
Or you can download the binary directly from https://github.com/hit9/bitproto/releases/tag/v0.4.4
from bitproto.
Related Issues (9)
- Feature: add a "packed" or `-p` flag HOT 3
- Representing enums as enum.IntEnum HOT 4
- Seems like flatbuffers and cap'n proto, are there any comparasion to these projects? HOT 2
- Does bitproto support `union`? HOT 3
- Simple example fails Python 3.10.8 HOT 1
- Ambiguity about the functionality of Encode/Decode HOT 5
- Invalid enum field name on imported proto on python generation HOT 1
- Image on the Readme.md does not respresent what the library is doing HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bitproto.