google / google/emboss

Support Lists of Variable-Length Structures.

Open
#51 1 comment 0 reactions 0 assignees View on GitHub
enhancement language feature
Dominant language
Python
Stars
92
Forks
30
PR merge metrics
No merged PRs in 30d

Description

It is currently possible to (somewhat hackily) support lists by modeling them as recursive structures, like so:

```
struct Repeated(remaining_size : UInt:32):
0 [+4] UInt length
# ... other fields ...
if remaining_size > length:
length [+remaining_size - length] Repeated next
```

However, there should be a nicer syntax for specifying that there is a list of `Repeated` elements, with a C++ API that supports iteration (but not random access).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.