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

Issue with simple object parse #30

Closed
earce opened this issue Dec 10, 2020 · 2 comments
Closed

Issue with simple object parse #30

earce opened this issue Dec 10, 2020 · 2 comments
Assignees

Comments

@earce
Copy link

earce commented Dec 10, 2020

Hi,

I am getting the following error:

Detected atomic field definition without type

When running the following:

final JBBPParser marketParser = JBBPParser.prepare(
                "byte[5] blob5; "
                + "accountFlags {"
                + " byte[32] address; "
                + "}; "
                + "byte[7] blob7;"
);

I suspect it has to do with the fact that I am passing 32 into the byte array for address. The example:

final JBBPParser pngParser = JBBPParser.prepare(
              "long header;"
              + "chunk [_]{"
              + "   int length; "
              + "   int type; "
              + "   byte[length] data; "
              + "   int crc;"
              + "}"
      );

shows you passing the length which is calculated as the message is read dynamically. Is there a way to statically set this to 32?

@raydac
Copy link
Owner

raydac commented Dec 10, 2020

Hello
you just have syntax error in structure definition, it must not have ; after }

@raydac raydac self-assigned this Dec 10, 2020
@earce
Copy link
Author

earce commented Dec 10, 2020

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants