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

Parsing binary type with macros in size fails #1052

Open
kvakvs opened this issue Nov 19, 2024 · 0 comments
Open

Parsing binary type with macros in size fails #1052

kvakvs opened this issue Nov 19, 2024 · 0 comments

Comments

@kvakvs
Copy link
Collaborator

kvakvs commented Nov 19, 2024

The following should parse into a binary type.

-define(TXS_HASH_BYTES, 32).
-type(txs_hash() :: <<_:(?TXS_HASH_BYTES*8)>>).

More examples:

-type fr_bin() :: <<_:?FR_SIZE>>.
-type fp_bin() :: <<_:?FP_SIZE>>.

Current behaviour: Bad syntax.
Blocker: Macros expand into numbers, but the plugin does not preprocess macros.

Expected behaviour: Successfully parsed and syntax coloring working (at least neutral solid colour).
Possible temporary workaround: Assume that macro resolves to something that's allowed in this position. An integer?

@kvakvs kvakvs changed the title Parsing binary type with size fails Parsing binary type with macros in size fails Nov 19, 2024
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