-
Notifications
You must be signed in to change notification settings - Fork 25
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
User guide documentation update #5
base: master
Are you sure you want to change the base?
Changes from 1 commit
20a399b
e8e3fe2
e5a6375
78f6e58
5f258c8
25e86c7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -832,6 +832,39 @@ other value which was not listed explicitly. | |
_: rec_type_unknown | ||
---- | ||
|
||
If an enumeration has already been defined, you can use references to | ||
items in the enumeration instead of specifying integers a second time: | ||
|
||
[source,yaml] | ||
---- | ||
seq: | ||
- id: key | ||
type: u4 | ||
enum: keys | ||
- id: data | ||
type: | ||
switch-on: key | ||
cases: | ||
keys::width: data_field_width | ||
keys::height: data_field_height | ||
keys::depth: data_field_depth | ||
types: | ||
data_field_width: | ||
seq: | ||
#... | ||
data_field_height: | ||
seq: | ||
#... | ||
data_field_depth: | ||
seq: | ||
#... | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Pedantic person in me cries for that misaligned types:
data_field_width: # ...
data_field_height: # ...
data_field_depth: # ... for brevity. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks, agreed |
||
enums: | ||
keys: | ||
0x77696474: width #widt | ||
0x68656967: height #heig | ||
0x64657074: depth #dept | ||
---- | ||
|
||
=== Instances: data beyond the sequence | ||
|
||
So far we've done all the data specifications in `seq` - thus they'll | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, if you defined
key
as enum, then you don't have much choice. You can't compare enums to integers without additional conversions.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm good point, I'll update the text accordingly