Giter Site home page Giter Site logo

Comments (4)

hit9 avatar hit9 commented on May 22, 2024 2

@g-berthiaume

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.

Yzw-Yogo avatar Yzw-Yogo commented on May 22, 2024

@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.

g-berthiaume avatar g-berthiaume commented on May 22, 2024

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.

hit9 avatar hit9 commented on May 22, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.