google / google/emboss

`$next` isn't usable in setting virtual fields

Open
#132 0 comments 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

Suppose I have the following Emboss definition:

```
struct Foo:
0 [+1] UInt bar
$next [+1] UInt baz

let version_0_01_size = $next
```

If I wanted to store the current offset in a virtual field such that I can access it in code later, I'm currently unable to do this. I get the following error:

```
error: Keyword `$next` may not be used in this context.
```

I think this would be pretty useful to have so as to avoid repeating values or potentially make mistakes in counting offsets.

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.